Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 9e66254

Browse files
authored
Merge pull request #341 from HackIllinois/dev
2020.2.1-rc1
2 parents 048f437 + 2404103 commit 9e66254

File tree

17 files changed

+122
-61
lines changed

17 files changed

+122
-61
lines changed

HIAPI/Models/Announcement.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,23 @@ public struct AnnouncementContainer: Decodable, APIReturnable {
3030

3131
public struct Announcement: Codable {
3232
internal enum CodingKeys: String, CodingKey {
33+
case topic
3334
case title
3435
case body
3536
case time
36-
case roles = "topicName"
3737
}
3838

3939
public init(from decoder: Decoder) throws {
4040
let container = try decoder.container(keyedBy: CodingKeys.self)
41+
self.topic = try container.decode(String.self, forKey: .topic)
4142
self.title = try container.decode(String.self, forKey: .title)
4243
self.body = try container.decode(String.self, forKey: .body)
4344
let time = try container.decode(Double.self, forKey: .time)
4445
self.time = Date(timeIntervalSince1970: time)
45-
let role = try container.decode(String.self, forKey: .roles)
46-
self.roles = try Roles(string: role)
4746
}
4847

48+
public let topic: String
4949
public let title: String
5050
public let body: String
5151
public let time: Date
52-
public let roles: Roles
5352
}

HIAPI/Services/AnnouncementService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public final class AnnouncementService: BaseService {
3737
}
3838

3939
public static func getAllAnnouncements() -> APIRequest<AnnouncementContainer> {
40-
return APIRequest<AnnouncementContainer>(service: self, endpoint: "all/", method: .GET)
40+
return APIRequest<AnnouncementContainer>(service: self, endpoint: "topic/all/", method: .GET)
4141
}
4242
}

HackIllinois.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,12 @@
932932
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
933933
CODE_SIGN_IDENTITY = "iPhone Developer";
934934
CODE_SIGN_STYLE = Automatic;
935-
CURRENT_PROJECT_VERSION = 7;
935+
CURRENT_PROJECT_VERSION = 3;
936936
DEVELOPMENT_TEAM = 8VNQTQM2L6;
937937
GCC_C_LANGUAGE_STANDARD = gnu11;
938938
INFOPLIST_FILE = Stickers/Info.plist;
939939
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
940-
MARKETING_VERSION = 2020.2;
940+
MARKETING_VERSION = 2020.2.1;
941941
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios.stickers;
942942
PRODUCT_NAME = "$(TARGET_NAME)";
943943
SKIP_INSTALL = YES;
@@ -953,12 +953,12 @@
953953
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
954954
CODE_SIGN_IDENTITY = "iPhone Developer";
955955
CODE_SIGN_STYLE = Automatic;
956-
CURRENT_PROJECT_VERSION = 7;
956+
CURRENT_PROJECT_VERSION = 3;
957957
DEVELOPMENT_TEAM = 8VNQTQM2L6;
958958
GCC_C_LANGUAGE_STANDARD = gnu11;
959959
INFOPLIST_FILE = Stickers/Info.plist;
960960
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
961-
MARKETING_VERSION = 2020.2;
961+
MARKETING_VERSION = 2020.2.1;
962962
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios.stickers;
963963
PRODUCT_NAME = "$(TARGET_NAME)";
964964
SKIP_INSTALL = YES;
@@ -1085,14 +1085,14 @@
10851085
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10861086
CODE_SIGN_ENTITLEMENTS = HackIllinois/HackIllinois.entitlements;
10871087
CODE_SIGN_IDENTITY = "iPhone Developer";
1088-
CURRENT_PROJECT_VERSION = 7;
1088+
CURRENT_PROJECT_VERSION = 3;
10891089
DEVELOPMENT_TEAM = 8VNQTQM2L6;
10901090
INFOPLIST_FILE = HackIllinois/Info.plist;
10911091
LD_RUNPATH_SEARCH_PATHS = (
10921092
"$(inherited)",
10931093
"@executable_path/Frameworks",
10941094
);
1095-
MARKETING_VERSION = 2020.2;
1095+
MARKETING_VERSION = 2020.2.1;
10961096
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -Xfrontend -warn-long-expression-type-checking=150";
10971097
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
10981098
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1108,14 +1108,14 @@
11081108
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11091109
CODE_SIGN_ENTITLEMENTS = HackIllinois/HackIllinois.entitlements;
11101110
CODE_SIGN_IDENTITY = "iPhone Developer";
1111-
CURRENT_PROJECT_VERSION = 7;
1111+
CURRENT_PROJECT_VERSION = 3;
11121112
DEVELOPMENT_TEAM = 8VNQTQM2L6;
11131113
INFOPLIST_FILE = HackIllinois/Info.plist;
11141114
LD_RUNPATH_SEARCH_PATHS = (
11151115
"$(inherited)",
11161116
"@executable_path/Frameworks",
11171117
);
1118-
MARKETING_VERSION = 2020.2;
1118+
MARKETING_VERSION = 2020.2.1;
11191119
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
11201120
PRODUCT_NAME = "$(TARGET_NAME)";
11211121
SWIFT_VERSION = 5.0;
@@ -1132,7 +1132,7 @@
11321132
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
11331133
CODE_SIGN_IDENTITY = "";
11341134
CODE_SIGN_STYLE = Automatic;
1135-
CURRENT_PROJECT_VERSION = 7;
1135+
CURRENT_PROJECT_VERSION = 3;
11361136
DEFINES_MODULE = YES;
11371137
DEVELOPMENT_TEAM = 8VNQTQM2L6;
11381138
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1146,7 +1146,7 @@
11461146
"@executable_path/Frameworks",
11471147
"@loader_path/Frameworks",
11481148
);
1149-
MARKETING_VERSION = 2020.2;
1149+
MARKETING_VERSION = 2020.2.1;
11501150
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
11511151
MTL_FAST_MATH = YES;
11521152
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.HIAPI;
@@ -1169,7 +1169,7 @@
11691169
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
11701170
CODE_SIGN_IDENTITY = "";
11711171
CODE_SIGN_STYLE = Automatic;
1172-
CURRENT_PROJECT_VERSION = 7;
1172+
CURRENT_PROJECT_VERSION = 3;
11731173
DEFINES_MODULE = YES;
11741174
DEVELOPMENT_TEAM = 8VNQTQM2L6;
11751175
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1183,7 +1183,7 @@
11831183
"@executable_path/Frameworks",
11841184
"@loader_path/Frameworks",
11851185
);
1186-
MARKETING_VERSION = 2020.2;
1186+
MARKETING_VERSION = 2020.2.1;
11871187
MTL_FAST_MATH = YES;
11881188
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.HIAPI;
11891189
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
511 Bytes
Loading
669 Bytes
Loading
1.1 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "[email protected]",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "[email protected]",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "[email protected]",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
25+
}
26+
}

HackIllinois/DataSources/HIAnnouncementDataSource.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ final class HIAnnouncementDataSource {
6565
coreDataAnnouncementsToUpdate.forEach { (coreDataAnnouncement, apiAnnouncement) in
6666
// Update CoreData Announcement.
6767
coreDataAnnouncement.title = apiAnnouncement.title
68-
coreDataAnnouncement.info = apiAnnouncement.body
68+
coreDataAnnouncement.body = apiAnnouncement.body
6969
coreDataAnnouncement.time = apiAnnouncement.time
70-
coreDataAnnouncement.roles = Int32(apiAnnouncement.roles.rawValue)
70+
coreDataAnnouncement.topic = apiAnnouncement.topic
7171
}
7272

7373
apiAnnouncementsToInsert.forEach { apiAnnouncement in
7474
// Create CoreData announcement.
7575
let coreDataAnnouncement = Announcement(context: context)
76-
coreDataAnnouncement.time = apiAnnouncement.time
77-
coreDataAnnouncement.info = apiAnnouncement.body
7876
coreDataAnnouncement.title = apiAnnouncement.title
79-
coreDataAnnouncement.roles = Int32(apiAnnouncement.roles.rawValue)
77+
coreDataAnnouncement.body = apiAnnouncement.body
78+
coreDataAnnouncement.time = apiAnnouncement.time
79+
coreDataAnnouncement.topic = apiAnnouncement.topic
8080
}
8181

8282
// 10) Save changes, call completion handler, unlock refresh
@@ -104,9 +104,8 @@ final class HIAnnouncementDataSource {
104104
let title = data["title"] as? String,
105105
let body = data["body"] as? String,
106106
let seconds = data["time"] as? TimeInterval,
107-
let topicName = data["topicName"] as? String,
108-
let roles = try? HIAPI.Roles(string: topicName) else { return }
109-
let time = Date(timeIntervalSince1970: seconds)
107+
let topic = data["topic"] as? String else { return }
108+
let time = Date(timeIntervalSince1970: seconds)
110109

111110
HICoreDataController.shared.performBackgroundTask { context -> Void in
112111
do {
@@ -118,9 +117,9 @@ final class HIAnnouncementDataSource {
118117
// 2) Update the announcement if it exists, otherwise create it.
119118
let coreDataAnnouncement = coreDataAnnouncements.first ?? Announcement(context: context)
120119
coreDataAnnouncement.title = title
121-
coreDataAnnouncement.info = body
120+
coreDataAnnouncement.body = body
122121
coreDataAnnouncement.time = time
123-
coreDataAnnouncement.roles = Int32(roles.rawValue)
122+
coreDataAnnouncement.topic = topic
124123

125124
// 3) Save changes, call completion handler.
126125
try context.save()

HackIllinois/Models/CoreDataModels/Announcement+CoreDataProperties.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ extension Announcement {
1919
return NSFetchRequest<Announcement>(entityName: "Announcement")
2020
}
2121

22-
@NSManaged public var info: String
22+
@NSManaged public var topic: String
23+
@NSManaged public var body: String
2324
@NSManaged public var time: Date
2425
@NSManaged public var title: String
25-
@NSManaged public var roles: Int32
2626

2727
}

HackIllinois/Models/CoreDataModels/HackIllinois.xcdatamodeld/HackIllinois.xcdatamodel/contents

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="15702" systemVersion="19C57" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
2+
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="15702" systemVersion="19D76" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
33
<entity name="Announcement" representedClassName="Announcement" syncable="YES">
4-
<attribute name="info" attributeType="String"/>
5-
<attribute name="roles" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
4+
<attribute name="body" attributeType="String"/>
65
<attribute name="time" attributeType="Date" usesScalarValueType="NO"/>
76
<attribute name="title" attributeType="String"/>
7+
<attribute name="topic" optional="YES" attributeType="String"/>
88
<uniquenessConstraints>
99
<uniquenessConstraint>
1010
<constraint value="time"/>
@@ -55,7 +55,7 @@
5555
</uniquenessConstraints>
5656
</entity>
5757
<elements>
58-
<element name="Announcement" positionX="-63" positionY="72" width="128" height="105"/>
58+
<element name="Announcement" positionX="-63" positionY="72" width="128" height="103"/>
5959
<element name="Event" positionX="-54" positionY="36" width="128" height="178"/>
6060
<element name="Location" positionX="-54" positionY="108" width="128" height="103"/>
6161
<element name="Project" positionX="-45" positionY="108" width="128" height="163"/>

0 commit comments

Comments
 (0)