forked from firka/student-legacy
Bitcode removal, Crash fixed caused by Live Activity
This commit is contained in:
parent
414755c777
commit
658bfe38a3
@ -43,4 +43,21 @@ post_install do |installer|
|
|||||||
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
|
||||||
|
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
|
||||||
|
framework_path = File.join(Dir.pwd, framework_relative_path)
|
||||||
|
command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
|
||||||
|
puts "Stripping bitcode: #{command}"
|
||||||
|
system(command)
|
||||||
|
end
|
||||||
|
|
||||||
|
framework_paths = [
|
||||||
|
"Pods/Shake/Sources/Shake.xcframework/ios-arm64/Shake.framework/Shake",
|
||||||
|
"Pods/Shake/Sources/Shake.xcframework/ios-arm64_x86_64-simulator/Shake.framework/Shake"
|
||||||
|
]
|
||||||
|
|
||||||
|
framework_paths.each do |framework_relative_path|
|
||||||
|
strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@
|
|||||||
<key>livecard.xcscheme_^#shared#^_</key>
|
<key>livecard.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>83</integer>
|
<integer>86</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
@ -1,40 +1,44 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import ActivityKit
|
|
||||||
|
|
||||||
public struct LessonData {
|
public struct LessonData {
|
||||||
var color: String
|
var color: String
|
||||||
var icon: String
|
var icon: String
|
||||||
var index: String
|
var index: String
|
||||||
var title: String
|
var title: String
|
||||||
var subtitle: String
|
var subtitle: String
|
||||||
var description: String
|
var description: String
|
||||||
var startDate: Date
|
var startDate: Date
|
||||||
var endDate: Date
|
var endDate: Date
|
||||||
var date: ClosedRange<Date>
|
var date: ClosedRange<Date>
|
||||||
var nextSubject: String
|
var nextSubject: String
|
||||||
var nextRoom: String
|
var nextRoom: String
|
||||||
|
|
||||||
|
init(from dictionary: [String: Any]) {
|
||||||
|
self.color = dictionary["color"] as? String ?? ""
|
||||||
|
self.icon = dictionary["icon"] as? String ?? ""
|
||||||
|
self.index = dictionary["index"] as? String ?? ""
|
||||||
|
self.title = dictionary["title"] as? String ?? ""
|
||||||
|
self.subtitle = dictionary["subtitle"] as? String ?? ""
|
||||||
|
self.description = dictionary["description"] as? String ?? ""
|
||||||
|
self.nextSubject = dictionary["nextSubject"] as? String ?? ""
|
||||||
|
self.nextRoom = dictionary["nextRoom"] as? String ?? ""
|
||||||
|
|
||||||
init(from dictionary: [String: Any]) {
|
if let startDateStr = dictionary["startDate"] as? String, let startDateInt = Int(startDateStr) {
|
||||||
self.color = dictionary["color"] as? String ?? ""
|
self.startDate = Date(timeIntervalSince1970: TimeInterval(startDateInt) / 1000)
|
||||||
self.icon = dictionary["icon"] as? String ?? ""
|
} else {
|
||||||
self.index = dictionary["index"] as? String ?? ""
|
self.startDate = Date()
|
||||||
self.title = dictionary["title"] as? String ?? ""
|
|
||||||
self.subtitle = dictionary["subtitle"] as? String ?? ""
|
|
||||||
self.description = dictionary["description"] as? String ?? ""
|
|
||||||
self.nextSubject = dictionary["nextSubject"] as? String ?? ""
|
|
||||||
self.nextRoom = dictionary["nextRoom"] as? String ?? ""
|
|
||||||
|
|
||||||
if let startDateStr = dictionary["startDate"] as? String, let startDateInt = Int(startDateStr) {
|
|
||||||
self.startDate = Date(timeIntervalSince1970: TimeInterval(startDateInt) / 1000)
|
|
||||||
} else {
|
|
||||||
self.startDate = Date()
|
|
||||||
}
|
|
||||||
|
|
||||||
if let endDateStr = dictionary["endDate"] as? String, let endDateInt = Int(endDateStr) {
|
|
||||||
self.endDate = Date(timeIntervalSince1970: TimeInterval(endDateInt) / 1000)
|
|
||||||
} else {
|
|
||||||
self.endDate = Date()
|
|
||||||
}
|
|
||||||
date = self.startDate...self.endDate
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let endDateStr = dictionary["endDate"] as? String, let endDateInt = Int(endDateStr) {
|
||||||
|
self.endDate = Date(timeIntervalSince1970: TimeInterval(endDateInt) / 1000)
|
||||||
|
} else {
|
||||||
|
self.endDate = self.startDate
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.startDate <= self.endDate {
|
||||||
|
self.date = self.startDate...self.endDate
|
||||||
|
} else {
|
||||||
|
self.date = self.endDate...self.endDate
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,19 +64,11 @@ struct LockScreenLiveActivityView: View {
|
|||||||
.padding(.trailing, 90)
|
.padding(.trailing, 90)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
MultilineTextView(text: "\(context.state.index) \(context.state.title)", limit: 25)
|
MultilineTextView(text: "\(context.state.index) \(context.state.title) - \(context.state.subtitle)", limit: 25)
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.bold()
|
.bold()
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Terem
|
|
||||||
if (!context.state.subtitle.isEmpty) {
|
|
||||||
Text(context.state.subtitle)
|
|
||||||
.italic()
|
|
||||||
.bold()
|
|
||||||
.font(.system(size: 13))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leírás
|
// Leírás
|
||||||
@ -92,10 +84,8 @@ struct LockScreenLiveActivityView: View {
|
|||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fit)
|
.aspectRatio(contentMode: .fit)
|
||||||
.frame(width: CGFloat(8), height: CGFloat(8))
|
.frame(width: CGFloat(8), height: CGFloat(8))
|
||||||
Text(context.state.nextSubject)
|
Text("\(context.state.nextSubject) - \(context.state.nextRoom)")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
Text(context.state.nextRoom)
|
|
||||||
.font(.caption2)
|
|
||||||
}
|
}
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
} else {
|
} else {
|
||||||
@ -197,33 +187,23 @@ struct LiveCardWidget: Widget {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Amikor óra van, expanded DynamicIsland
|
// Amikor óra van, expanded DynamicIsland
|
||||||
MultilineTextView(text: "\(context.state.index) \(context.state.title)", limit: 25)
|
MultilineTextView(text: "\(context.state.index) \(context.state.title) - \(context.state.subtitle)", limit: 25)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.bold()
|
.bold()
|
||||||
.padding(.trailing, -35)
|
.padding(.trailing, -35)
|
||||||
|
|
||||||
Text(context.state.subtitle)
|
Spacer(minLength: 2)
|
||||||
.lineLimit(1)
|
|
||||||
.italic()
|
|
||||||
.bold()
|
|
||||||
.font(.system(size: 13))
|
|
||||||
.padding(.trailing, -50)
|
|
||||||
|
|
||||||
Spacer(minLength: 5)
|
|
||||||
|
|
||||||
if(context.state.nextRoom != "" && context.state.nextSubject != "") {
|
if(context.state.nextRoom != "" && context.state.nextSubject != "") {
|
||||||
Text("Következő óra és terem:")
|
Text("Következő óra és terem:")
|
||||||
.font(.system(size: 14))
|
.font(.system(size: 14))
|
||||||
.padding(.trailing, -35)
|
.padding(.trailing, -45)
|
||||||
Spacer(minLength: 2)
|
Spacer(minLength: 2)
|
||||||
Text(context.state.nextSubject)
|
|
||||||
.modifier(DynamicFontSizeModifier(text: context.state.nextSubject))
|
Text("\(context.state.nextSubject) - \(context.state.nextRoom)")
|
||||||
.padding(.trailing, -35)
|
.modifier(DynamicFontSizeModifier(text: "\(context.state.nextSubject) - \(context.state.nextRoom)"))
|
||||||
Text(context.state.nextRoom)
|
.padding(.trailing, 35)
|
||||||
// ignore: based on nextSubject characters, I check that the font size of the room is the same as the next subject.
|
|
||||||
.modifier(DynamicFontSizeModifier(text: context.state.nextSubject))
|
|
||||||
.padding(.trailing, -35)
|
|
||||||
} else {
|
} else {
|
||||||
Text("Ez az utolsó óra! Kitartást!")
|
Text("Ez az utolsó óra! Kitartást!")
|
||||||
.font(.system(size: 14))
|
.font(.system(size: 14))
|
||||||
@ -327,3 +307,66 @@ struct DynamicFontSizeModifier: ViewModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct LiveCardWidget_Previews: PreviewProvider {
|
||||||
|
|
||||||
|
static let attributes = LiveActivitiesAppAttributes()
|
||||||
|
|
||||||
|
static let duringLessonExmaple = LiveActivitiesAppAttributes.ContentState(
|
||||||
|
color: "#FF5733",
|
||||||
|
icon: "bell",
|
||||||
|
index: "1.",
|
||||||
|
title: "Math Class",
|
||||||
|
subtitle: "101",
|
||||||
|
description: "Algebra lesson",
|
||||||
|
startDate: Date(),
|
||||||
|
endDate: Date().addingTimeInterval(3000),
|
||||||
|
date: Date()...Date().addingTimeInterval(3000), // 50 minutes later
|
||||||
|
nextSubject: "Physics",
|
||||||
|
nextRoom: "102"
|
||||||
|
)
|
||||||
|
|
||||||
|
static let inBreak = LiveActivitiesAppAttributes.ContentState(
|
||||||
|
color: "#FF5733",
|
||||||
|
icon: "house",
|
||||||
|
index: "",
|
||||||
|
title: "Szünet",
|
||||||
|
subtitle: "Menj a(z) 122 terembe.",
|
||||||
|
description: "",
|
||||||
|
startDate: Date(),
|
||||||
|
endDate: Date().addingTimeInterval(3000),
|
||||||
|
date: Date()...Date().addingTimeInterval(3000), // 50 minutes later
|
||||||
|
nextSubject: "Physics",
|
||||||
|
nextRoom: "122"
|
||||||
|
)
|
||||||
|
|
||||||
|
static let lastLesson = LiveActivitiesAppAttributes.ContentState(
|
||||||
|
color: "#00ff00",
|
||||||
|
icon: "bell",
|
||||||
|
index: "6.",
|
||||||
|
title: "Math Class",
|
||||||
|
subtitle: "",
|
||||||
|
description: "Lorem Ipsum",
|
||||||
|
startDate: Date(),
|
||||||
|
endDate: Date().addingTimeInterval(3000),
|
||||||
|
date: Date()...Date().addingTimeInterval(3000), // 50 minutes later
|
||||||
|
nextSubject: "",
|
||||||
|
nextRoom: ""
|
||||||
|
)
|
||||||
|
|
||||||
|
static var previews: some View {
|
||||||
|
// Dynamic Island Compact
|
||||||
|
Group {
|
||||||
|
attributes
|
||||||
|
.previewContext(duringLessonExmaple, viewKind: .dynamicIsland(.compact))
|
||||||
|
.previewDisplayName("During Lesson")
|
||||||
|
attributes
|
||||||
|
.previewContext(inBreak, viewKind: .dynamicIsland(.compact))
|
||||||
|
.previewDisplayName("In Break")
|
||||||
|
attributes
|
||||||
|
.previewContext(lastLesson, viewKind: .dynamicIsland(.compact))
|
||||||
|
.previewDisplayName("During Last Lesson")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user