Post

Replies

Boosts

Views

Activity

I can only see one sale in the Sales and Trends category.
While the app was pre-ordered, there was a sale in Canada and I can see it in the Sales and Trends category. (June 13) However, yesterday there was a sale in Turkey, but I can't see it in the Sales and Trends category. Does it take long for Apple to update this list? There was a sale from Turkey yesterday, but I can't see it. Why is that ? And I can't select yesterday's date. There was a sale from Turkey yesterday. I can't see this.
0
0
645
Jun ’21
show wrong answer in multiple selection in SwiftUI
When a wrong option is selected, I want to show the wrong option in red and then the correct option in green automatically. But I couldn't do the algorithm for it. How can I do that ? I prepared a sample project about the structure I use. I couldn't show the correct option and the wrong option at the same time when only the wrong option was selected. Model struct QuestionContainer: Codable, Hashable { var questions: [Question]? } struct Section: Codable, Hashable { var a, b, c, d: String private enum CodingKeys: String, CodingKey { case a = "A" case b = "B" case c = "C" case d = "D" } } struct Question: Codable, Hashable { var number: Int? var question: String? var sections: Section? var price: Int? var correct: String? } QuestionView struct QuestionView: View { @ObservedObject var questionViewModel: QuestionViewModel var body: some View { VStack { Text(questionViewModel.question.questions?[0].question ?? "empty") SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.a ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.b ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.c ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.d ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) } } } QuestionViewModel class QuestionViewModel: ObservableObject { @Published var question: QuestionContainer = QuestionContainer() init() { getQuestions() } func getQuestions() { question = QuestionContainer(questions: [Question(number: 1, question: "What is the chemical formula for water ?", sections: Section(a: "CO2", b: "H2O", c: "C2H6O", d: "H2N"), price: 5, correct: "H2O")]) } } SectionView struct SectionView: View { @ObservedObject var sectionViewModel: SectionViewModel @State var color: UIColor = .gray var body: some View { Button(action: { sectionViewModel.selected = sectionViewModel.section color = sectionViewModel.prepareResultColor() print("correct: \(sectionViewModel.correct)") print("selected: \(sectionViewModel.selected)") }) { ZStack { RoundedRectangle(cornerRadius: 20) .stroke(Color(color), lineWidth: 2) .frame(width: 340, height: 50) HStack { Text(sectionViewModel.section) .foregroundColor(Color(UIColor.gray)) .bold() Spacer() ZStack { Circle() .foregroundColor(Color(UIColor.orange)) Circle() .stroke(Color(UIColor.orange).opacity(0.4), lineWidth: 2) Image(systemName: "checkmark") .resizable() .frame(width: 12, height: 12) .font(.system(size: 15, weight: .bold, design: .rounded)) .foregroundColor(.white) } .frame(width: 20, height: 20) } .padding(.horizontal) .padding(.vertical, 12) .frame(width: 340) } } } } SectionViewModel class SectionViewModel: ObservableObject { @Published var section: String = "" @Published var correct: String = "" @Published var selected: String = "" init(section: String, correct: String) { self.section = section self.correct = correct } func prepareResultColor() -> UIColor { if correct == selected && selected != "" { return .green } else if correct != selected && selected != "" { return .red } else { return .gray } } }
0
0
526
Jun ’21
SwiftUI Generic Binding Array
https://developer.apple.com/forums/thread/652064 how can I solve my problem like here or in a different way. When I make the Binding variable generic, I want to access the image property in the Array.  I am trying to make it a Generi Array. I will take two different models in it and I want to reach the image property in the model. How can I do that ? I use two different models in different page transitions. How can I make the array holding the model generic? Model 1: struct TrafficSignContainer: Codable, Hashable {     var trafficQuestions: [TrafficSign]? } enum TrafficSignSectionType: String, Codable, Hashable {     case A = "A"     case B = "B" } struct TrafficSign: Codable, Hashable {     var id: Int?     var image: String?     var sections: [TrafficSignSectionType.RawValue : String]?     var correct: String? } Model 2: struct PoliceSignContainer: Codable, Hashable {     var policeQuestions: [PoliceSign]? } enum PoliceSignSectionType: String, Codable, Hashable {     case A = "A"     case B = "B"     case C = "C" } struct PoliceSign: Codable, Hashable {     var id: Int?     var image: String?     var sections: [PoliceSignSectionType.RawValue : String]?     var correct: String? } View: struct QuestionCardViewd: View {     @EnvironmentObject var signQuestionProvider: SignQuestionProvider     @EnvironmentObject var optionConfigure: OptionConfigure     @Binding var questions: [T]     var body: some View {         VStack {             HStack {                 Text("\(optionConfigure.step + 1) /")                     .bold()                 Text("\(optionConfigure.questionCount)")             }             .padding(5)            .background(Color(UIColor.secondarySystemBackground))             .cornerRadius(10)             .offset(y: -25)             ZStack {                 ForEach((questions.indices).reversed(), id: \.self) { index -> AnyView in                     let relativeIndex = index - optionConfigure.step                     switch relativeIndex {                     case 0...2:                         return AnyView(                             ImageCard(image: .constant("\(questions[index].image ?? "p1")")) **//-> here **                                 .offset(y: CGFloat(relativeIndex * -35))                                 .opacity(2.5 - Double(relativeIndex))                                 .scaleEffect(1 - CGFloat(relativeIndex) * 0.1)                         )                     default:                         return AnyView(EmptyView())                     }                 }             }             .animation(.spring())             OptionView()         }         .onDisappear {             optionConfigure.step = 0             optionConfigure.selected = ""         }     } }
1
0
1.5k
Aug ’21
Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate.
I am getting the following error while saving data to CoreData. I made this project completely simple for you to review my project. There is Local json in the project. You can download and test my project. Project GitLab Link: Core Data Test Project 2021-08-20 23:15:33.153215+0300 CoreDataTest[29156:2365912] [error] warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate. CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate. 2021-08-20 23:15:33.153422+0300 CoreDataTest[29156:2365912] [error] warning:   'QuestionCD' (0x282ef02c0) from NSManagedObjectModel (0x283ad45f0) claims 'QuestionCD'. ....... Failed to save selected category: A Core Data error occurred. Source Editor Functionality Is Limited Error (What is this ? / Why ?): Core Data Entities: Core Data Save Function: func saveSelectedQuestion(questionTitle: String, id: String, questions: [QuestionList]) { let questionsCD = QuestionCD(context: persistentContainer.viewContext) questionsCD.title = questionTitle questionsCD.id = id questionsCD.questions = questions do { try persistentContainer.viewContext.save() } catch { print("Failed to save selected category: \(error.localizedDescription)") } } Model: class QuestionContainer: NSObject, Codable { var questionCategories: [Question] init(questionCategories: [Question]) { self.questionCategories = questionCategories } } class Question: NSObject, Codable { var title: String var id: String var questions: [QuestionList] init(title: String, id: String, questions: [QuestionList]) { self.title = title self.id = id self.questions = questions } } public class QuestionList: NSObject, Codable { init(id: String, question: String, isQuestionImage: Bool, isSectionImage: Bool, imageURL: String, imageData: Data? = nil, sections: Sections, selected: String, correct: String) { self.id = id self.question = question self.isQuestionImage = isQuestionImage self.isSectionImage = isSectionImage self.imageURL = imageURL self.imageData = imageData self.sections = sections self.selected = selected self.correct = correct } var id: String var question: String var isQuestionImage, isSectionImage: Bool var imageURL: String var imageData: Data? var sections: Sections var selected: String var correct: String } public class Sections: NSObject, Codable { init(a: String, b: String, c: String, d: String) { self.a = a self.b = b self.c = c self.d = d } var a, b, c, d: String private enum CodingKeys: String, CodingKey { case a = "A" case b = "B" case c = "C" case d = "D" } } Page Where I Save Data: I am saving data from this page. struct QuestionCategoryCellView: View { @ObservedObject var questionCategoryCellViewModel = QuestionCategoryCellViewModel() var questionTitle: String var questionID: String @Binding var questions: [QuestionList] var body: some View { Button(action: { print("title: \(questionTitle)") if questionCategoryCellViewModel.searchCategoryInCoreData(id: questionID) { print("already saved") } else { questionCategoryCellViewModel.saveSelectedQuestionsToCoreData(questionTitle: questionTitle, id: questionID, questions: questions) } }) { Text(questionTitle) } } }
0
0
2.1k
Aug ’21
Are VIPER, RIBs, Redux and VIP applicable for SwiftUI?
Which design pattern should I choose for SwiftUI? SwiftUI introduced its own set of challenges in the system’s design, so the patterns we had for UIKit have to be re-designed from the ground up. The completely new design of the data flow in SwiftUI coupled with native support of view-state bindings shrank the required setup code to the degree that Presenter becomes a goofy entity doing nothing useful.
1
0
730
Nov ’21
[Core Data]: threw while encoding a value. with userInfo of (null)
I am getting the following error while saving data to CoreData. my model has the dictionary property. I created NSSecureCoding and NSSecureUnarchiveFromDataTransformer classes. please check if i can encode my model correctly. I couldn't understand what I am doing wrong ? The problem is not with Dictionary or Data properties. Why can't I save data to CoreData? I know little English. Thank you for your understanding. GitLab Project Link: It is a very simple one page project. I will be glad if you check it out. Core Data Test Project Console Output: 2021-08-21 23:58:18.490834+0300 CoreDataTest[35689:2901360] [error] error: SQLCore dispatchRequest: exception handling request: <NSSQLSaveChangesRequestContext: 0x2827f0240> , <shared NSSecureUnarchiveFromData transformer> threw while encoding a value. with userInfo of (null) CoreData: error: SQLCore dispatchRequest: exception handling request: <NSSQLSaveChangesRequestContext: 0x2827f0240> , <shared NSSecureUnarchiveFromData transformer> threw while encoding a value. with userInfo of (null) Failed to save selected category: A Core Data error occurred. Core Data Entity: My Custom Model: Notice my model has a Dictionary. var sections: [QuestionSections.RawValue : String] I am trying to save dictionary in CoreData. I thought the problem was in the dictionary but the problem is not in the dictionary. class QuestionContainer: NSObject, Codable { var questionCategories: [Question] init(questionCategories: [Question]) { self.questionCategories = questionCategories } } public class Question: NSObject, Codable { var title: String var id: String var questions: [QuestionList] init(title: String, id: String, questions: [QuestionList]) { self.title = title self.id = id self.questions = questions } } public class QuestionList: NSObject, Codable { init(id: String, question: String, isQuestionImage: Bool, isSectionImage: Bool, imageURL: String, imageData: Data? = nil, sections: [QuestionSections.RawValue : String], selected: String, correct: String) { self.id = id self.question = question self.isQuestionImage = isQuestionImage self.isSectionImage = isSectionImage self.imageURL = imageURL self.imageData = imageData self.sections = sections self.selected = selected self.correct = correct } var id: String var question: String var isQuestionImage, isSectionImage: Bool var imageURL: String var imageData: Data? var sections: [QuestionSections.RawValue : String] var selected: String var correct: String } enum QuestionSections: String, Codable { case A = "A" case B = "B" case C = "C" case D = "D" } NSSecure Unarchive From Data Transformer: @objc(QuestionsValueTransformer) class QuestionsValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: QuestionsValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [QuestionsNSSecureCoding.self] } public static func register() { let transformer = QuestionsValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } } CoreData Save Function: func saveSelectedQuestion(questionTitle: String, id: String, questions: [QuestionList]) { let questionsCD = QuestionCD(context: persistentContainer.viewContext) questionsCD.title = questionTitle questionsCD.id = id questionsCD.questions = questions do { try persistentContainer.viewContext.save() } catch { print("Failed to save selected category: \(error.localizedDescription)") } }
1
0
2.4k
Jul ’23
Guideline 5.2.3 - Legal - Intellectual Property - Audio/Video Downloading
Hello everyone, I developed an iOS mobile application that allows users to download videos from platforms other than YouTube. However, Apple rejected my app due to Guideline 5.2.3 - Legal - Intellectual Property - Audio/Video Downloading. Some apps also offer similar features. So, how were these apps published? If anyone has a similar experience or knowledge about this, could you please help? Thank you!
1
0
1.2k
Oct ’24
I can only see one sale in the Sales and Trends category.
While the app was pre-ordered, there was a sale in Canada and I can see it in the Sales and Trends category. (June 13) However, yesterday there was a sale in Turkey, but I can't see it in the Sales and Trends category. Does it take long for Apple to update this list? There was a sale from Turkey yesterday, but I can't see it. Why is that ? And I can't select yesterday's date. There was a sale from Turkey yesterday. I can't see this.
Replies
0
Boosts
0
Views
645
Activity
Jun ’21
show wrong answer in multiple selection in SwiftUI
When a wrong option is selected, I want to show the wrong option in red and then the correct option in green automatically. But I couldn't do the algorithm for it. How can I do that ? I prepared a sample project about the structure I use. I couldn't show the correct option and the wrong option at the same time when only the wrong option was selected. Model struct QuestionContainer: Codable, Hashable { var questions: [Question]? } struct Section: Codable, Hashable { var a, b, c, d: String private enum CodingKeys: String, CodingKey { case a = "A" case b = "B" case c = "C" case d = "D" } } struct Question: Codable, Hashable { var number: Int? var question: String? var sections: Section? var price: Int? var correct: String? } QuestionView struct QuestionView: View { @ObservedObject var questionViewModel: QuestionViewModel var body: some View { VStack { Text(questionViewModel.question.questions?[0].question ?? "empty") SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.a ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.b ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.c ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) SectionView(sectionViewModel: SectionViewModel(section: questionViewModel.question.questions?[0].sections?.d ?? "empty", correct: questionViewModel.question.questions?[0].correct ?? "empty")) } } } QuestionViewModel class QuestionViewModel: ObservableObject { @Published var question: QuestionContainer = QuestionContainer() init() { getQuestions() } func getQuestions() { question = QuestionContainer(questions: [Question(number: 1, question: "What is the chemical formula for water ?", sections: Section(a: "CO2", b: "H2O", c: "C2H6O", d: "H2N"), price: 5, correct: "H2O")]) } } SectionView struct SectionView: View { @ObservedObject var sectionViewModel: SectionViewModel @State var color: UIColor = .gray var body: some View { Button(action: { sectionViewModel.selected = sectionViewModel.section color = sectionViewModel.prepareResultColor() print("correct: \(sectionViewModel.correct)") print("selected: \(sectionViewModel.selected)") }) { ZStack { RoundedRectangle(cornerRadius: 20) .stroke(Color(color), lineWidth: 2) .frame(width: 340, height: 50) HStack { Text(sectionViewModel.section) .foregroundColor(Color(UIColor.gray)) .bold() Spacer() ZStack { Circle() .foregroundColor(Color(UIColor.orange)) Circle() .stroke(Color(UIColor.orange).opacity(0.4), lineWidth: 2) Image(systemName: "checkmark") .resizable() .frame(width: 12, height: 12) .font(.system(size: 15, weight: .bold, design: .rounded)) .foregroundColor(.white) } .frame(width: 20, height: 20) } .padding(.horizontal) .padding(.vertical, 12) .frame(width: 340) } } } } SectionViewModel class SectionViewModel: ObservableObject { @Published var section: String = "" @Published var correct: String = "" @Published var selected: String = "" init(section: String, correct: String) { self.section = section self.correct = correct } func prepareResultColor() -> UIColor { if correct == selected && selected != "" { return .green } else if correct != selected && selected != "" { return .red } else { return .gray } } }
Replies
0
Boosts
0
Views
526
Activity
Jun ’21
SwiftUI Generic Binding Array
https://developer.apple.com/forums/thread/652064 how can I solve my problem like here or in a different way. When I make the Binding variable generic, I want to access the image property in the Array.  I am trying to make it a Generi Array. I will take two different models in it and I want to reach the image property in the model. How can I do that ? I use two different models in different page transitions. How can I make the array holding the model generic? Model 1: struct TrafficSignContainer: Codable, Hashable {     var trafficQuestions: [TrafficSign]? } enum TrafficSignSectionType: String, Codable, Hashable {     case A = "A"     case B = "B" } struct TrafficSign: Codable, Hashable {     var id: Int?     var image: String?     var sections: [TrafficSignSectionType.RawValue : String]?     var correct: String? } Model 2: struct PoliceSignContainer: Codable, Hashable {     var policeQuestions: [PoliceSign]? } enum PoliceSignSectionType: String, Codable, Hashable {     case A = "A"     case B = "B"     case C = "C" } struct PoliceSign: Codable, Hashable {     var id: Int?     var image: String?     var sections: [PoliceSignSectionType.RawValue : String]?     var correct: String? } View: struct QuestionCardViewd: View {     @EnvironmentObject var signQuestionProvider: SignQuestionProvider     @EnvironmentObject var optionConfigure: OptionConfigure     @Binding var questions: [T]     var body: some View {         VStack {             HStack {                 Text("\(optionConfigure.step + 1) /")                     .bold()                 Text("\(optionConfigure.questionCount)")             }             .padding(5)            .background(Color(UIColor.secondarySystemBackground))             .cornerRadius(10)             .offset(y: -25)             ZStack {                 ForEach((questions.indices).reversed(), id: \.self) { index -> AnyView in                     let relativeIndex = index - optionConfigure.step                     switch relativeIndex {                     case 0...2:                         return AnyView(                             ImageCard(image: .constant("\(questions[index].image ?? "p1")")) **//-> here **                                 .offset(y: CGFloat(relativeIndex * -35))                                 .opacity(2.5 - Double(relativeIndex))                                 .scaleEffect(1 - CGFloat(relativeIndex) * 0.1)                         )                     default:                         return AnyView(EmptyView())                     }                 }             }             .animation(.spring())             OptionView()         }         .onDisappear {             optionConfigure.step = 0             optionConfigure.selected = ""         }     } }
Replies
1
Boosts
0
Views
1.5k
Activity
Aug ’21
Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate.
I am getting the following error while saving data to CoreData. I made this project completely simple for you to review my project. There is Local json in the project. You can download and test my project. Project GitLab Link: Core Data Test Project 2021-08-20 23:15:33.153215+0300 CoreDataTest[29156:2365912] [error] warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate. CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'QuestionCD' so +entity is unable to disambiguate. 2021-08-20 23:15:33.153422+0300 CoreDataTest[29156:2365912] [error] warning:   'QuestionCD' (0x282ef02c0) from NSManagedObjectModel (0x283ad45f0) claims 'QuestionCD'. ....... Failed to save selected category: A Core Data error occurred. Source Editor Functionality Is Limited Error (What is this ? / Why ?): Core Data Entities: Core Data Save Function: func saveSelectedQuestion(questionTitle: String, id: String, questions: [QuestionList]) { let questionsCD = QuestionCD(context: persistentContainer.viewContext) questionsCD.title = questionTitle questionsCD.id = id questionsCD.questions = questions do { try persistentContainer.viewContext.save() } catch { print("Failed to save selected category: \(error.localizedDescription)") } } Model: class QuestionContainer: NSObject, Codable { var questionCategories: [Question] init(questionCategories: [Question]) { self.questionCategories = questionCategories } } class Question: NSObject, Codable { var title: String var id: String var questions: [QuestionList] init(title: String, id: String, questions: [QuestionList]) { self.title = title self.id = id self.questions = questions } } public class QuestionList: NSObject, Codable { init(id: String, question: String, isQuestionImage: Bool, isSectionImage: Bool, imageURL: String, imageData: Data? = nil, sections: Sections, selected: String, correct: String) { self.id = id self.question = question self.isQuestionImage = isQuestionImage self.isSectionImage = isSectionImage self.imageURL = imageURL self.imageData = imageData self.sections = sections self.selected = selected self.correct = correct } var id: String var question: String var isQuestionImage, isSectionImage: Bool var imageURL: String var imageData: Data? var sections: Sections var selected: String var correct: String } public class Sections: NSObject, Codable { init(a: String, b: String, c: String, d: String) { self.a = a self.b = b self.c = c self.d = d } var a, b, c, d: String private enum CodingKeys: String, CodingKey { case a = "A" case b = "B" case c = "C" case d = "D" } } Page Where I Save Data: I am saving data from this page. struct QuestionCategoryCellView: View { @ObservedObject var questionCategoryCellViewModel = QuestionCategoryCellViewModel() var questionTitle: String var questionID: String @Binding var questions: [QuestionList] var body: some View { Button(action: { print("title: \(questionTitle)") if questionCategoryCellViewModel.searchCategoryInCoreData(id: questionID) { print("already saved") } else { questionCategoryCellViewModel.saveSelectedQuestionsToCoreData(questionTitle: questionTitle, id: questionID, questions: questions) } }) { Text(questionTitle) } } }
Replies
0
Boosts
0
Views
2.1k
Activity
Aug ’21
Are VIPER, RIBs, Redux and VIP applicable for SwiftUI?
Which design pattern should I choose for SwiftUI? SwiftUI introduced its own set of challenges in the system’s design, so the patterns we had for UIKit have to be re-designed from the ground up. The completely new design of the data flow in SwiftUI coupled with native support of view-state bindings shrank the required setup code to the degree that Presenter becomes a goofy entity doing nothing useful.
Replies
1
Boosts
0
Views
730
Activity
Nov ’21
[Core Data]: threw while encoding a value. with userInfo of (null)
I am getting the following error while saving data to CoreData. my model has the dictionary property. I created NSSecureCoding and NSSecureUnarchiveFromDataTransformer classes. please check if i can encode my model correctly. I couldn't understand what I am doing wrong ? The problem is not with Dictionary or Data properties. Why can't I save data to CoreData? I know little English. Thank you for your understanding. GitLab Project Link: It is a very simple one page project. I will be glad if you check it out. Core Data Test Project Console Output: 2021-08-21 23:58:18.490834+0300 CoreDataTest[35689:2901360] [error] error: SQLCore dispatchRequest: exception handling request: <NSSQLSaveChangesRequestContext: 0x2827f0240> , <shared NSSecureUnarchiveFromData transformer> threw while encoding a value. with userInfo of (null) CoreData: error: SQLCore dispatchRequest: exception handling request: <NSSQLSaveChangesRequestContext: 0x2827f0240> , <shared NSSecureUnarchiveFromData transformer> threw while encoding a value. with userInfo of (null) Failed to save selected category: A Core Data error occurred. Core Data Entity: My Custom Model: Notice my model has a Dictionary. var sections: [QuestionSections.RawValue : String] I am trying to save dictionary in CoreData. I thought the problem was in the dictionary but the problem is not in the dictionary. class QuestionContainer: NSObject, Codable { var questionCategories: [Question] init(questionCategories: [Question]) { self.questionCategories = questionCategories } } public class Question: NSObject, Codable { var title: String var id: String var questions: [QuestionList] init(title: String, id: String, questions: [QuestionList]) { self.title = title self.id = id self.questions = questions } } public class QuestionList: NSObject, Codable { init(id: String, question: String, isQuestionImage: Bool, isSectionImage: Bool, imageURL: String, imageData: Data? = nil, sections: [QuestionSections.RawValue : String], selected: String, correct: String) { self.id = id self.question = question self.isQuestionImage = isQuestionImage self.isSectionImage = isSectionImage self.imageURL = imageURL self.imageData = imageData self.sections = sections self.selected = selected self.correct = correct } var id: String var question: String var isQuestionImage, isSectionImage: Bool var imageURL: String var imageData: Data? var sections: [QuestionSections.RawValue : String] var selected: String var correct: String } enum QuestionSections: String, Codable { case A = "A" case B = "B" case C = "C" case D = "D" } NSSecure Unarchive From Data Transformer: @objc(QuestionsValueTransformer) class QuestionsValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: QuestionsValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [QuestionsNSSecureCoding.self] } public static func register() { let transformer = QuestionsValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } } CoreData Save Function: func saveSelectedQuestion(questionTitle: String, id: String, questions: [QuestionList]) { let questionsCD = QuestionCD(context: persistentContainer.viewContext) questionsCD.title = questionTitle questionsCD.id = id questionsCD.questions = questions do { try persistentContainer.viewContext.save() } catch { print("Failed to save selected category: \(error.localizedDescription)") } }
Replies
1
Boosts
0
Views
2.4k
Activity
Jul ’23
Guideline 5.2.3 - Legal - Intellectual Property - Audio/Video Downloading
Hello everyone, I developed an iOS mobile application that allows users to download videos from platforms other than YouTube. However, Apple rejected my app due to Guideline 5.2.3 - Legal - Intellectual Property - Audio/Video Downloading. Some apps also offer similar features. So, how were these apps published? If anyone has a similar experience or knowledge about this, could you please help? Thank you!
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’24