diff --git a/Leganto.xcodeproj/project.pbxproj b/Leganto.xcodeproj/project.pbxproj index 91eae28..6821cdb 100644 --- a/Leganto.xcodeproj/project.pbxproj +++ b/Leganto.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 860920F32A1E917600CED32F /* FeedParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 860920F22A1E917600CED32F /* FeedParser.swift */; }; 86B4633C2A1A382800CBBE76 /* LegantoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B4633B2A1A382800CBBE76 /* LegantoApp.swift */; }; 86B463412A1A382800CBBE76 /* Leganto.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 86B4633F2A1A382800CBBE76 /* Leganto.xcdatamodeld */; }; 86B463432A1A382800CBBE76 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B463422A1A382800CBBE76 /* ContentView.swift */; }; @@ -18,11 +17,9 @@ 86B4635A2A1A499300CBBE76 /* AddFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B463592A1A499300CBBE76 /* AddFeedView.swift */; }; 86B4635C2A1D1C6C00CBBE76 /* FeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B4635B2A1D1C6C00CBBE76 /* FeedView.swift */; }; 86B4635E2A1D217B00CBBE76 /* FeedViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B4635D2A1D217B00CBBE76 /* FeedViewCell.swift */; }; - 86B463612A1D346700CBBE76 /* FeedKit in Frameworks */ = {isa = PBXBuildFile; productRef = 86B463602A1D346700CBBE76 /* FeedKit */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 860920F22A1E917600CED32F /* FeedParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedParser.swift; sourceTree = ""; }; 86B463382A1A382800CBBE76 /* Leganto.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Leganto.app; sourceTree = BUILT_PRODUCTS_DIR; }; 86B4633B2A1A382800CBBE76 /* LegantoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegantoApp.swift; sourceTree = ""; }; 86B463402A1A382800CBBE76 /* Leganto.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Leganto.xcdatamodel; sourceTree = ""; }; @@ -35,8 +32,6 @@ 86B463592A1A499300CBBE76 /* AddFeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedView.swift; sourceTree = ""; }; 86B4635B2A1D1C6C00CBBE76 /* FeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedView.swift; sourceTree = ""; }; 86B4635D2A1D217B00CBBE76 /* FeedViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedViewCell.swift; sourceTree = ""; }; - 86B463622A1D37C400CBBE76 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 86B463632A1D387100CBBE76 /* eo */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eo; path = eo.lproj/Localizable.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -44,7 +39,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 86B463612A1D346700CBBE76 /* FeedKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -70,7 +64,6 @@ 86B4633A2A1A382800CBBE76 /* Leganto */ = { isa = PBXGroup; children = ( - 86B463622A1D37C400CBBE76 /* Info.plist */, 86B4635D2A1D217B00CBBE76 /* FeedViewCell.swift */, 86B4633B2A1A382800CBBE76 /* LegantoApp.swift */, 86B463422A1A382800CBBE76 /* ContentView.swift */, @@ -82,7 +75,6 @@ 86B463472A1A382B00CBBE76 /* Preview Content */, 86B463592A1A499300CBBE76 /* AddFeedView.swift */, 86B4635B2A1D1C6C00CBBE76 /* FeedView.swift */, - 860920F22A1E917600CED32F /* FeedParser.swift */, ); path = Leganto; sourceTree = ""; @@ -111,9 +103,6 @@ dependencies = ( ); name = Leganto; - packageProductDependencies = ( - 86B463602A1D346700CBBE76 /* FeedKit */, - ); productName = Leganto; productReference = 86B463382A1A382800CBBE76 /* Leganto.app */; productType = "com.apple.product-type.application"; @@ -140,12 +129,8 @@ knownRegions = ( Base, "en-GB", - eo, ); mainGroup = 86B4632F2A1A382800CBBE76; - packageReferences = ( - 86B4635F2A1D346700CBBE76 /* XCRemoteSwiftPackageReference "FeedKit" */, - ); productRefGroup = 86B463392A1A382800CBBE76 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -177,7 +162,6 @@ 86B463582A1A42D100CBBE76 /* DataController.swift in Sources */, 86B4635A2A1A499300CBBE76 /* AddFeedView.swift in Sources */, 86B4633C2A1A382800CBBE76 /* LegantoApp.swift in Sources */, - 860920F32A1E917600CED32F /* FeedParser.swift in Sources */, 86B4635C2A1D1C6C00CBBE76 /* FeedView.swift in Sources */, 86B4635E2A1D217B00CBBE76 /* FeedViewCell.swift in Sources */, 86B463432A1A382800CBBE76 /* ContentView.swift in Sources */, @@ -191,7 +175,6 @@ isa = PBXVariantGroup; children = ( 86B463562A1A3ECE00CBBE76 /* en-GB */, - 86B463632A1D387100CBBE76 /* eo */, ); name = Localizable.strings; sourceTree = ""; @@ -323,9 +306,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = Leganto/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Leganto; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.reference"; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -345,8 +326,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -366,9 +345,7 @@ ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = Leganto/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Leganto; - INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.reference"; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -388,8 +365,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -419,25 +394,6 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - 86B4635F2A1D346700CBBE76 /* XCRemoteSwiftPackageReference "FeedKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/nmdias/FeedKit.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 9.0.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - 86B463602A1D346700CBBE76 /* FeedKit */ = { - isa = XCSwiftPackageProductDependency; - package = 86B4635F2A1D346700CBBE76 /* XCRemoteSwiftPackageReference "FeedKit" */; - productName = FeedKit; - }; -/* End XCSwiftPackageProductDependency section */ - /* Begin XCVersionGroup section */ 86B4633F2A1A382800CBBE76 /* Leganto.xcdatamodeld */ = { isa = XCVersionGroup; diff --git a/Leganto.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Leganto.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 9ea620b..0000000 --- a/Leganto.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "pins" : [ - { - "identity" : "feedkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/nmdias/FeedKit.git", - "state" : { - "revision" : "68493a33d862c33c9a9f67ec729b3b7df1b20ade", - "version" : "9.1.2" - } - } - ], - "version" : 2 -} diff --git a/Leganto/AddFeedView.swift b/Leganto/AddFeedView.swift index ecf381b..e0b5e21 100644 --- a/Leganto/AddFeedView.swift +++ b/Leganto/AddFeedView.swift @@ -25,7 +25,6 @@ struct AddFeed: View { } #else AddFeedContent() - .padding(.all) #endif } } @@ -53,14 +52,6 @@ struct AddFeedContent: View { } } .toolbar { - ToolbarItem { - Button { - dismiss() - } label: { - Text("cancel") - } - - } ToolbarItem { Button(action: addItem) { Text("save") diff --git a/Leganto/ContentView.swift b/Leganto/ContentView.swift index 6ebe300..04c03be 100644 --- a/Leganto/ContentView.swift +++ b/Leganto/ContentView.swift @@ -10,7 +10,7 @@ import CoreData struct ContentView: View { @Environment(\.managedObjectContext) var moc - @FetchRequest(sortDescriptors: [SortDescriptor(\.name)], animation: .default) var feeds: FetchedResults + @FetchRequest(sortDescriptors: [], animation: .default) var feeds: FetchedResults @State private var showAddScreen = false @@ -19,7 +19,7 @@ struct ContentView: View { List { ForEach(feeds) { item in NavigationLink { - FeedView(feedURL: URL(string: item.url!)!, feedName: item.name!) + FeedView(source: item) } label: { HStack { if Genre(rawValue: item.genre) == .news { diff --git a/Leganto/DataController.swift b/Leganto/DataController.swift index e72650d..9dcbfc9 100644 --- a/Leganto/DataController.swift +++ b/Leganto/DataController.swift @@ -52,7 +52,6 @@ class DataController: ObservableObject { init(inMemory: Bool = false) { container = NSPersistentCloudKitContainer(name: "Leganto") - if inMemory { container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null") } @@ -73,17 +72,7 @@ class DataController: ObservableObject { fatalError("Unresolved error \(error), \(error.userInfo)") } }) - - /* -#if DEBUG -do { - try container.initializeCloudKitSchema() -} catch { - let err = error as NSError - fatalError("Unresolved error \(err), \(err.userInfo)") -} -#endif - */ + container.viewContext.automaticallyMergesChangesFromParent = true } } diff --git a/Leganto/FeedParser.swift b/Leganto/FeedParser.swift deleted file mode 100644 index 4ed25e0..0000000 --- a/Leganto/FeedParser.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// FeedParser.swift -// Leganto -// -// Created by Louis Hollingworth on 2023-05-24. -// - -import Foundation -import FeedKit - -class LFeedParser: ObservableObject { - var urlStr: String - @Published var rssFeed: RSSFeed? - @Published var atomFeed: AtomFeed? - @Published var jsonFeed: JSONFeed? - - init(urlStr: String) { - self.urlStr = urlStr - } - - func loadData() { - if let url = URL(string: urlStr) { - let parser = FeedParser(URL: url) - - parser.parseAsync { (result) in - - switch result { - case .success(let feed): - switch feed { - case let .atom(feed): - self.atomFeed = feed - case let .json(feed): - self.jsonFeed = feed - case let .rss(feed): - self.rssFeed = feed - } - case .failure(let err): - print(err) - } - - DispatchQueue.main.async { - self.objectWillChange.send() - } - } - } - - } -} diff --git a/Leganto/FeedView.swift b/Leganto/FeedView.swift index 5fa90bd..89cac57 100644 --- a/Leganto/FeedView.swift +++ b/Leganto/FeedView.swift @@ -6,21 +6,16 @@ // import SwiftUI -import FeedKit struct FeedView: View { - var feed: Feed - @ObservedObject var parsed: LFeedParser = LFeedParser(urlStr: "https://git.ludoviko.ch/lucxjo/leganto-apple.rss") + var source: Feed var body: some View { List { - if let feed = parsed.jsonFeed { - ForEach(feed.items!, id: \.id!) { item in - FeedViewCell(title: item.title!, author: item.author!, date: Date(), - content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") - } + ForEach(1..<20) { item in + FeedViewCell() } } - .navigationTitle(feed.name!) + .navigationTitle(source.name!) } } diff --git a/Leganto/FeedViewCell.swift b/Leganto/FeedViewCell.swift index 7c40b60..5f7299f 100644 --- a/Leganto/FeedViewCell.swift +++ b/Leganto/FeedViewCell.swift @@ -8,41 +8,25 @@ import SwiftUI struct FeedViewCell: View { - let title: String - let author: String - let date: Date - let content: String - var body: some View { VStack(alignment: .leading) { - Text(title) + Text("Title") .font(.title) HStack { - Text(author) + Text("Author") Spacer() - Text(date, formatter: dateFormatter) + Text("Date") } .font(.footnote) - Text(content) + Text("Content") .font(.body) } .multilineTextAlignment(.leading) } } -private let dateFormatter: DateFormatter = { - let formatter = DateFormatter() - formatter.dateStyle = .short - formatter.timeStyle = .short - return formatter -}() - - struct FeedViewCell_Previews: PreviewProvider { static var previews: some View { - FeedViewCell( - title: "Test", author: "Test Author", date: Date(), - content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." - ) + FeedViewCell() } } diff --git a/Leganto/Info.plist b/Leganto/Info.plist deleted file mode 100644 index 062d626..0000000 --- a/Leganto/Info.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - CFBundleURLTypes - - - - UIBackgroundModes - - remote-notification - - - diff --git a/Leganto/Leganto.entitlements b/Leganto/Leganto.entitlements index 3e1a2cc..f2ef3ae 100644 --- a/Leganto/Leganto.entitlements +++ b/Leganto/Leganto.entitlements @@ -2,21 +2,9 @@ - aps-environment - development - com.apple.developer.aps-environment - development - com.apple.developer.icloud-container-identifiers - - iCloud.ch.ludoviko.Leganto - - com.apple.developer.icloud-services - - CloudKit - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-only - + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + diff --git a/Leganto/de.lproj/Localizable.strings b/Leganto/de.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/Leganto/de.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Leganto/en-GB.lproj/Localizable.strings b/Leganto/en-GB.lproj/Localizable.strings index 86873dd..eb8bf1b 100644 --- a/Leganto/en-GB.lproj/Localizable.strings +++ b/Leganto/en-GB.lproj/Localizable.strings @@ -9,7 +9,6 @@ // General "feeds" = "Feeds"; "save" = "Save"; -"cancel" = "Cancel"; "name" = "Name"; "desc" = "Description"; "url" = "URL"; diff --git a/Leganto/eo.lproj/Localizable.strings b/Leganto/eo.lproj/Localizable.strings deleted file mode 100644 index e78145f..0000000 --- a/Leganto/eo.lproj/Localizable.strings +++ /dev/null @@ -1,22 +0,0 @@ -/* - Localizable.strings - Leganto - - Created by Louis Hollingworth on 2023-05-21. - -*/ - -// General -"feeds" = "Fluoj"; -"save" = "Konservi"; -"cancel" = "Nuligi"; -"name" = "Nomo"; -"desc" = "Priskribo"; -"url" = "URL"; -"genre" = "Ĝenro"; -"fadd" = "Aldoni Fluon"; - -// Genre categories -"uncategorised" = "Nekategoriigita"; -"technology" = "Teĥnologio"; -"news" = "Novaĵoj"; diff --git a/Leganto/es.lproj/Localizable.strings b/Leganto/es.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/Leganto/es.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Leganto/fr.lproj/Localizable.strings b/Leganto/fr.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/Leganto/fr.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Leganto/nl.lproj/Localizable.strings b/Leganto/nl.lproj/Localizable.strings deleted file mode 100644 index 8b13789..0000000 --- a/Leganto/nl.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/README.md b/README.md index 7219f6b..25437aa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Leganto -[![Weblate project translated](https://img.shields.io/weblate/progress/leganto?color=ef9f76&logo=weblate&logoColor=ef9f76&server=https%3A%2F%2Fi18n.ludoviko.ch&style=for-the-badge&labelColor=414559)](https://i18n.ludoviko.ch/projects/leganto/leganto-apple/) An RSS reader.