diff --git a/README.md b/README.md index a1b1ddc..edaa95a 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,24 @@ ## WikipediaKit · API Client Framework for Swift -The [Wikipedia API](https://www.mediawiki.org/wiki/Special:ApiSandbox) is a complex beast. It takes some time (and willpower) to learn all of its idiosyncrasies. +The [Wikipedia API](https://www.mediawiki.org/wiki/Special:ApiSandbox) can do a lot, but it’s not easy to get started. -With WikipediaKit, it’s easy to build apps that search and show Wikipedia content—without worrying about the raw API. Instead of exposing all options and endpoints, WikipediaKit provides comfortable access to the most interesting parts. It’s opinionated—but that’s the point! +With WikipediaKit, it’s easy to build apps that search and show Wikipedia content—without worrying about the raw API. Instead of exposing all options and endpoints, WikipediaKit provides comfortable access to the most interesting parts for building a reader app. WikipediaKit comes with opinions and an attitude—but that’s the point! The WikipediaKit framework is written in Swift, has no third-party dependencies, and runs on macOS, iOS, watchOS, and tvOS. -If this doesn’t convince you to build a shiny new reader app for Wikipedia yourself, have a look at [V for Wiki](http://v-for-wiki.com), the award-winning app that WikipediaKit was created for. +If this doesn’t convince you to build a shiny new reader app for Wikipedia yourself, have a look at [V for Wiki](http://v-for-wiki.com), the award-winning app that WikipediaKit was created for. The shipping version on the iOS App Store uses exactly the code that you can explore and download here. ## Installation +### Swift Package Manager (preferred) +WikipediaKit can be added to your Xcode project using the [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). + ### Carthage You can use [Carthage](https://github.com/Carthage/Carthage) to install and update WikipediaKit. ### Manual Drag and drop the `WikipediaKit.xcodeproj` to your app project and add the `WikipediaKit` embedded framework in your app project’s build settings. -### Swift Package Manager - -WikipediaKit is ready for the [Swift Package Manager](https://swift.org/package-manager/). - ## Usage @@ -45,7 +44,7 @@ WikipediaNetworking.appAuthorEmailForAPI = "appauthor@example.com" WikipediaKit will use this email address and your app’s bundle info to generate and send a `User-Agent` header. This will identify your app to Wikipedia’s servers with every API request, as required by the [API guidelines](https://www.mediawiki.org/wiki/API:Main_page#Identifying_your_client). -The `User-Agent` header is printed to your Xcode console when you make the first API request. It’ll look something like this: +The `User-Agent` header is printed to your Xcode console when you make the first API request. It’ll look similar to this: ``` User-Agent: ExampleApp/1.0 (com.example.ExampleApp; appauthor@example.com) WikipediaKit/1.0 @@ -82,13 +81,13 @@ A `WikipediaLanguage` has a language code, a localized name, an [autonym](https: ```swift // French language, localized name for German, no variant -let l = WikipediaLanguage(code: "fr", +let l = WikipediaLanguage(code: "fr", localizedName: "Französisch", // FR in DE autonym: "Français") // FR in FR ``` -WikipediaKit comes with a list of most Wikipedia languages and their autonyms. This lets you initialize a `WikipediaLanguage` by passing only the language code. Please note that if you use this shorthand method, the localized names will be in English. +WikipediaKit comes with a list of Wikipedia languages and their autonyms. This lets you initialize a `WikipediaLanguage` by passing the language code. Please note that if you use this shorthand method, the localized names will be in English. ```swift let language = WikipediaLanguage("fr") @@ -106,7 +105,7 @@ let _ = Wikipedia.shared.requestOptimizedSearchResults(language: language, term: guard error == nil else { return } guard let searchResults = searchResults else { return } - + for articlePreview in searchResults.items { print(articlePreview.displayTitle) } @@ -148,22 +147,21 @@ The `displayTitle` and `displayText` can be formatted via your `WikipediaFormatt ### Articles +*Update: Since WikipediaKit 3.0, this method uses the new Wikipedia REST API. The rewrite was a good opportunity to modernize WikipediaKit and return a `Result` type.* + Load the article about “[Soft rime](https://en.wikipedia.org/wiki/Soft_rime)” in English like this: ```swift let language = WikipediaLanguage("en") -// You need to pass in the maximum width -// in pixels for the returned thumbnail URL, -// for example the screen width: -let imageWidth = Int(self.view.frame.size.width * UIScreen.main.scale) - -let _ = Wikipedia.shared.requestArticle(language: language, title: "Soft rime", imageWidth: imageWidth) { (article, error) in - guard error == nil else { return } - guard let article = article else { return } - - print(article.displayTitle) - print(article.displayText) +let _ = Wikipedia.shared.requestArticle(language: language, title: "Soft rime") { result in + switch result { + case .success(let article): + print(article.displayTitle) + print(article.displayText) + case .failure(let error): + print(error) + } } ``` @@ -184,10 +182,10 @@ This search mode returns geo-tagged articles around a specific location. Pass in let language = WikipediaLanguage("en") let _ = Wikipedia.shared.requestNearbyResults(language: language, latitude: 52.4555592, longitude: 13.3175333) { (articlePreviews, resultsLanguage, error) in - + guard error == nil else { return } guard let articlePreviews = articlePreviews else { return } - + for a in articlePreviews { print(a.displayTitle) if let coordinate = a.coordinate { @@ -199,30 +197,29 @@ let _ = Wikipedia.shared.requestNearbyResults(language: language, latitude: 52.4 ``` -### Most Read Articles +### Featured Articles + +The `requestFeaturedArticles(language:date:)` query gets a list of the most popular articles for a specific date from Wikipedia’s official analytics. -The `requestMostReadArticles(language:date:)` query gets a list of the most popular articles for a specific date from Wikipedia’s official analytics. +*Please note: Versions of WikipediaKit before 3.0 used the raw data from an older Wikipedia API to implement this feature. The new (current) implementation uses the same new API as the official Wikipedia app, which seems to filter the articles, stripping out potentially offensive content.* ```swift let language = WikipediaLanguage("en") let dayBeforeYesterday = Date(timeIntervalSinceNow: -60 * 60 * 48) -let _ = Wikipedia.shared.requestMostReadArticles(language: language, date: dayBeforeYesterday) { (articlePreviews, date, resultsLanguage, error) in - - guard error == nil else { return } - guard let articlePreviews = articlePreviews else { return } - - for a in articlePreviews { - print(a.displayTitle) +let _ = Wikipedia.shared.requestFeaturedArticles(language: language, date: dayBeforeYesterday) { result in + switch result { + case .success(let featuredCollection): + for a in featuredCollection.mostReadArticles { + print(a.displayTitle) + } + case .failure(let error): + print(error) } } ``` -**Please note:** The API will return a `404` error if there’s no data available for the requested date. The most recent data is usually from yesterday, so receiving a `404` for today is expected. - -You may want to filter the results from the most read articles before displaying them in your app—they are potentially NSFW. That’s what the `WikipediaBlacklistDelegate` is for (see below). - ### Image Metadata To find out the URL for a given Wikipedia image at a specific size, use this call: @@ -231,7 +228,7 @@ To find out the URL for a given Wikipedia image at a specific size, use this cal let language = WikipediaLanguage("en") // You can pass multiple images here. -// Make sure to limit the number somehow +// Make sure to limit the number somehow // because the API server will bail out // if the query URL gets too long. @@ -243,7 +240,7 @@ let _ = Wikipedia.shared.(language: language, urls: urls, width: 1000) { (images print(metadata.url) // URL for 1000px width version print(metadata.description) print(metadata.license) - } + } } ``` @@ -274,7 +271,7 @@ You can parse and reformat article texts, titles, and the table of contents in y ```swift class MyFormattingDelegate: WikipediaTextFormattingDelegate { - + static let shared = MyFormattingDelegate() func format(context: WikipediaTextFormattingDelegateContext, rawText: String, title: String?, language: WikipediaLanguage, isHTML: Bool) -> String { @@ -285,31 +282,6 @@ class MyFormattingDelegate: WikipediaTextFormattingDelegate { ``` -### Blacklist Delegate - -```swift -Wikipedia.sharedBlacklistDelegate = MyBlacklistDelegate.shared -``` - -You may wish to filter the most read articles before showing them as recommendations in your app. The `WikipediaBlacklistDelegate` protocol allows you to blacklist articles by title or description. - -```swift -class MyBlacklistDelegate: WikipediaBlacklistDelegate { - - func isBlacklistedForRecommendations(title: String, - language: WikipediaLanguage) -> Bool { - // Decide if title is blacklisted here… - return false - } - - func containsBlacklistedWords(text: String, language: WikipediaLanguage) -> Bool { - // Decide if text contains blacklisted words… - return false - } - -} -``` - ## Caching Caching happens automatically (*after* processing and formatting) for search results and articles. WikipediaKit uses simple `NSCache` instances. @@ -324,7 +296,7 @@ Request an array of random `WikipediaArticlePreview` objects like this: ```swift Wikipedia.shared.requestRandomArticles(language: self.language, maxCount: 8, imageWidth: 640) { (articlePreviews, language, error) in - + guard let articlePreviews = articlePreviews else { return } for article in articlePreviews { @@ -333,12 +305,12 @@ Wikipedia.shared.requestRandomArticles(language: self.language, maxCount: 8, ima } ``` -WikipediaKit also has this convenience function that gets only one single random `WikipediaArticlePreview` at a time: +WikipediaKit has this convenience function that gets one single random `WikipediaArticlePreview` at a time: ```swift Wikipedia.shared.requestSingleRandomArticle(language: self.language, maxCount: 8, imageWidth: 640) { (article, language, error) in - + guard let article = article else { return } print(article.displayTitle) @@ -357,7 +329,7 @@ If `maxCount` is larger than `1`, the surplus results from the API query are buf WikipediaKit was created by [Frank Rausch](http://frankrausch.com) ([@frankrausch](https://twitter.com/frankrausch)) for [Raureif](http://raureif.net). -© 2017 Raureif GmbH / Frank Rausch +© 2017–20 Raureif GmbH / Frank Rausch ### License diff --git a/Sources/String+Wikipedia.swift b/Sources/String+Wikipedia.swift index 5f29f96..74f15e0 100644 --- a/Sources/String+Wikipedia.swift +++ b/Sources/String+Wikipedia.swift @@ -44,8 +44,7 @@ extension String { var characterSet = NSMutableCharacterSet.urlQueryAllowed - // Comma must not be encoded, otherwise the Most Read articles API call will not work on ru.wikipedia.org - var delimitersToEncode = ":#[]@!$?&'()*+=" + var delimitersToEncode = "#[]@!$?&'()*+=" if encodeSlashes { delimitersToEncode.append("/") diff --git a/Sources/Wikipedia+Article.swift b/Sources/Wikipedia+Article.swift index 0cddd9d..12cf97b 100644 --- a/Sources/Wikipedia+Article.swift +++ b/Sources/Wikipedia+Article.swift @@ -2,8 +2,8 @@ // Wikipedia+Article.swift // WikipediaKit // -// Created by Frank Rausch on 2017-03-21. -// Copyright © 2017 Raureif GmbH / Frank Rausch +// Created by Frank Rausch on 2020-09-01. +// Copyright © 2020 Raureif GmbH / Frank Rausch // // MIT License // @@ -35,82 +35,56 @@ extension Wikipedia { title: String, fragment: String? = nil, imageWidth: Int, - completion: @escaping (WikipediaArticle?, WikipediaError?)->()) + completion: @escaping (Result)->()) -> URLSessionDataTask? { if let cachedArticle = self.articleCache.get(language: language, title: title) { DispatchQueue.main.async { - completion(cachedArticle, nil) + completion(.success(cachedArticle)) } return nil } - - let parameters: [String:String] = [ - "action": "mobileview", - "format": "json", - "page": title, - "mobileformat": "1", - "prop": "id|text|sections|languagecount|displaytitle|description|image|thumb|pageprops", - "sections": "all", - "sectionprop": "toclevel|level|line|anchor", - "thumbwidth" : "\(imageWidth)", - "redirect": "yes", - "maxage": "\(self.maxAgeInSeconds)", - "smaxage": "\(self.maxAgeInSeconds)", - "uselang": language.variant ?? language.code, - ] - - guard let request = Wikipedia.buildURLRequest(language: language, parameters: parameters) else { + + let title = title.wikipediaURLEncodedString(encodeSlashes: true) + + let urlString = "https://\(language.code).wikipedia.org/api/rest_v1/page/mobile-sections/\(title)" + + guard let url = URL(string: urlString) + else { DispatchQueue.main.async { - completion(nil, .other(nil)) + completion(.failure(.other(nil))) } return nil } - + + let request = URLRequest(url: url) + return WikipediaNetworking.shared.loadJSON(urlRequest: request) { jsonDictionary, error in guard error == nil else { DispatchQueue.main.async { - completion (nil, error) + completion (.failure(error!)) } return } guard let jsonDictionary = jsonDictionary else { DispatchQueue.main.async { - completion (nil, .decodingError) + completion (.failure(.decodingError)) } return } - - if let apiError = jsonDictionary["error"] as? JSONDictionary, - let apiErrorInfo = apiError["info"] as? String { - - var wikipediaError: WikipediaError - - if let apiErrorCode = apiError["code"] as? String, - apiErrorCode == "missingtitle" { - - wikipediaError = .notFound - } else { - wikipediaError = .apiError(apiErrorInfo) + + if let article = WikipediaArticle(jsonDictionary: jsonDictionary, language: language, title: title, fragment: fragment, imageWidth: imageWidth) { + self.articleCache.add(article) + DispatchQueue.main.async { + completion(.success(article)) } - + } else { DispatchQueue.main.async { - completion (nil, wikipediaError) + completion(.failure(.decodingError)) } - return - } - - let article = WikipediaArticle(jsonDictionary: jsonDictionary, language: language, title: title, fragment: fragment) - - if let article = article { - self.articleCache.add(article) - } - - DispatchQueue.main.async { - completion(article, error) } } } diff --git a/Sources/Wikipedia+Featured.swift b/Sources/Wikipedia+Featured.swift new file mode 100644 index 0000000..cae8b74 --- /dev/null +++ b/Sources/Wikipedia+Featured.swift @@ -0,0 +1,85 @@ +// +// Wikipedia+Featured.swift +// WikipediaKit +// +// Created by Frank Rausch on 2020-08-28. +// Copyright © 2020 Raureif GmbH / Frank Rausch +// +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// “Software”), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + + +import Foundation + +extension Wikipedia { + + public func requestFeaturedArticles(language: WikipediaLanguage, + date: Date, + completion: @escaping (Result) -> ()) + -> URLSessionDataTask? { + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy/MM/dd" + + let dateString = dateFormatter.string(from: date) + + let urlString = "https://\(language.code).wikipedia.org/api/rest_v1/feed/featured/\(dateString)" + + guard let url = URL(string: urlString) + else { + DispatchQueue.main.async { + completion(.failure(.other(nil))) + } + return nil + } + + let request = URLRequest(url: url) + + return WikipediaNetworking.shared.loadJSON(urlRequest: request) { jsonDictionary, error in + + guard error == nil else { + // (also occurs when the request was cancelled programmatically) + DispatchQueue.main.async { + completion(.failure(error!)) + } + return + } + + guard let jsonDictionary = jsonDictionary else { + DispatchQueue.main.async { + completion(.failure(.decodingError)) + } + return + } + + if let featured = WikipediaFeatured(jsonDictionary: jsonDictionary, language: language) { + DispatchQueue.main.async { + completion(.success(featured)) + } + } else { + DispatchQueue.main.async { + completion(.failure(.noResults)) + } + } + } + } +} diff --git a/Sources/Wikipedia+MostRead.swift b/Sources/Wikipedia+MostRead.swift deleted file mode 100644 index 015274c..0000000 --- a/Sources/Wikipedia+MostRead.swift +++ /dev/null @@ -1,278 +0,0 @@ -// -// Wikipedia+MostRead.swift -// WikipediaKit -// -// Created by Frank Rausch on 2017-03-21. -// Copyright © 2017 Raureif GmbH / Frank Rausch -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// “Software”), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// - -import Foundation - -extension Wikipedia { - - public func requestMostReadArticles(language: WikipediaLanguage, - date: Date, - imageWidth: Int = 200, - maxCount: Int = 150, - completion: @escaping ([WikipediaArticlePreview]?, Date, WikipediaLanguage, WikipediaError?) -> ()) - -> URLSessionDataTask? { - - return self.requestMostReadArticleTitles(language: language, date: date) { titles, error in - - guard error == nil else { - DispatchQueue.main.async { - completion(nil, date, language, error) - } - return - } - - guard var titles = titles else { - DispatchQueue.main.async { - completion(nil, date, language, .notFound) - } - return - } - - titles = Array(titles.prefix(maxCount)) - - self.mostReadArticleDetailsRequest?.cancel() - - // FIXME: This cannot be cancelled. Should we save this in an ivar like the nested search? - self.mostReadArticleDetailsRequest = self.requestMostReadArticleDetails(language: language, titles: titles, imageWidth: imageWidth, maxCount: maxCount * 2) { results, error in - - guard error == nil else { - DispatchQueue.main.async { - completion(nil, date, language, error) - } - return - } - - guard var results = results else { - DispatchQueue.main.async { - completion(nil, date, language, error) - } - return - } - - for result in results { - // FIXME: Not ideal that we have to put the underscores back in. - result.index = titles.firstIndex(of: result.title.replacingOccurrences(of: " ", with: "_")) ?? 0 - } - - results.sort { $0.index < $1.index } - - DispatchQueue.main.async { - completion(results, date, language, error) - } - return - } - } - } - - - private func requestMostReadArticleTitles(language: WikipediaLanguage, - date: Date, - maxCount: Int = 50, - completion: @escaping ([String]?, WikipediaError?) -> ()) - -> URLSessionDataTask? { - - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "yyyy/MM/dd" - - let dateString = dateFormatter.string(from: date) - - let urlString = "https://wikimedia.org/api/rest_v1/metrics/pageviews/top/\(language.code).wikipedia.org/all-access/" + dateString - - guard let url = URL(string: urlString) - else { - DispatchQueue.main.async { - completion(nil, .other(nil)) - } - return nil - } - - let request = URLRequest(url: url) - - return WikipediaNetworking.shared.loadJSON(urlRequest: request) { jsonDictionary, error in - - guard error == nil else { - // (also occurs when the request was cancelled programmatically) - DispatchQueue.main.async { - completion (nil, error) - } - return - } - - guard let jsonDictionary = jsonDictionary else { - DispatchQueue.main.async { - completion (nil, .decodingError) - } - return - } - - guard let itemsArray = jsonDictionary["items"] as? [JSONDictionary], - let item = itemsArray.first, - let articlesArray = item["articles"] as? [JSONDictionary] else { - DispatchQueue.main.async { - completion (nil, .decodingError) - } - return - } - - var titles = [String]() - - for (i, article) in articlesArray.enumerated() { - if let title = article["article"] as? String { - titles.append(title) - if i >= maxCount - 1 { - break - } - } - } - - DispatchQueue.main.async { - completion(titles, error) - } - } - - } - - - private func requestMostReadArticleDetails(language: WikipediaLanguage, - titles: [String], - imageWidth: Int, - maxCount: Int, - completion: @escaping ([WikipediaArticlePreview]?, WikipediaError?) -> ()) - -> URLSessionDataTask? { - - var titlesString = titles.joined(separator: "|") - - if imageWidth == 0 { - print("WikipediaKit: The response will have no thumbnails because the imageWidth you passed is 0") - } - - if titlesString.wikipediaURLEncodedString().count > 4000 { - // FIXME: Find a more sophisticated solution for this. - // If the complete request URL is longer than ~5,400 characters, - // the Wikipedia server will drop the request - // and cause the NSURLSession to fail. - // This happens often for languages where Cyrillic is URL-encoded. - // See https://stackoverflow.com/a/417184 - titlesString = String(titlesString.prefix(950)) - } - - let parameters: [String:String] = [ - "action": "query", - "format": "json", - "formatversion" : "2", - "titles": titlesString, - "prop": "pageterms|pageimages", - "piprop": "thumbnail", - "pithumbsize" : "\(imageWidth)", - "pilimit": "50", // 50 is the API max - "continue": "", - "maxage": "\(self.maxAgeInSeconds)", - "smaxage": "\(self.maxAgeInSeconds)", - "uselang": language.variant ?? language.code, - ] - - guard let request = Wikipedia.buildURLRequest(language: language, parameters: parameters) - else { - DispatchQueue.main.async { - completion(nil, .other(nil)) - } - return nil - } - - return WikipediaNetworking.shared.loadJSON(urlRequest: request) { jsonDictionary, error in - - guard error == nil else { - // (also occurs when the request was cancelled programmatically) - DispatchQueue.main.async { - completion (nil, error) - } - return - } - - guard let jsonDictionary = jsonDictionary else { - DispatchQueue.main.async { - completion (nil, .decodingError) - } - return - } - - guard let query = jsonDictionary["query"] as? JSONDictionary else { - DispatchQueue.main.async { - // There is no query but also no error message if nothing is found. - completion (nil, .notFound) - } - return - } - - guard let pages = query["pages"] as? [JSONDictionary] else { - DispatchQueue.main.async { - completion (nil, .notFound) - } - return - } - - var results = [WikipediaArticlePreview]() - - for page in pages { - - if let isMissing = page["missing"] as? Bool, - isMissing == true { - continue - } - - if let namespace = page["ns"] as? Int, - namespace != WikipediaNamespace.main.rawValue { - continue - } - - if let title = page["title"] as? String, - Wikipedia.sharedBlacklistDelegate?.isBlacklistedForRecommendations(title: title, language: language) ?? false { - continue - } - - if let result = WikipediaArticlePreview(jsonDictionary: page, language: language) { - if !results.contains(result) { - if Wikipedia.sharedBlacklistDelegate?.containsBlacklistedWords(text: result.description, language: language) ?? false { - continue - } - - results.append(result) - } - } - - } - - results = Array(results.prefix(maxCount)) - DispatchQueue.main.async { - completion(results, error) - } - } - } - -} diff --git a/Sources/Wikipedia+RandomArticles.swift b/Sources/Wikipedia+RandomArticles.swift index f859181..3aa3afe 100644 --- a/Sources/Wikipedia+RandomArticles.swift +++ b/Sources/Wikipedia+RandomArticles.swift @@ -155,9 +155,7 @@ extension Wikipedia { for page in pages { if let result = WikipediaArticlePreview(jsonDictionary: page, language: language) { - if !(Wikipedia.sharedBlacklistDelegate?.isBlacklistedForRecommendations(title: result.title, language: result.language) ?? false) { - results.append(result) - } + results.append(result) } } diff --git a/Sources/Wikipedia.swift b/Sources/Wikipedia.swift index 5b99442..7d61040 100644 --- a/Sources/Wikipedia.swift +++ b/Sources/Wikipedia.swift @@ -41,7 +41,6 @@ public class Wikipedia { }() public static weak var sharedFormattingDelegate: WikipediaTextFormattingDelegate? - public static weak var sharedBlacklistDelegate: WikipediaBlacklistDelegate? let articleCache: WikipediaArticleCache = { return WikipediaArticleCache() diff --git a/Sources/WikipediaArticle.swift b/Sources/WikipediaArticle.swift index 925f7fa..7eeb5c4 100644 --- a/Sources/WikipediaArticle.swift +++ b/Sources/WikipediaArticle.swift @@ -2,8 +2,8 @@ // WikipediaArticle.swift // WikipediaKit // -// Created by Frank Rausch on 2016-07-25. -// Copyright © 2017 Raureif GmbH / Frank Rausch +// Created by Frank Rausch on 2020-09-01. +// Copyright © 2020 Raureif GmbH / Frank Rausch // // MIT License // @@ -88,84 +88,96 @@ public class WikipediaArticle { extension WikipediaArticle { - convenience init?(jsonDictionary dict: JSONDictionary, language: WikipediaLanguage, title: String, fragment: String? = nil) { + convenience init?(jsonDictionary dict: JSONDictionary, language: WikipediaLanguage, title: String, fragment: String? = nil, imageWidth: Int = 320) { - guard let mobileview = dict["mobileview"] as? JSONDictionary, - let sections = mobileview["sections"] as? [JSONDictionary] + guard let lead = dict["lead"] as? JSONDictionary, + let leadSections = lead["sections"] as? [JSONDictionary], + let leadFirstSection = leadSections.first, + let leadText = leadFirstSection["text"] as? String else { return nil } - + var text = "" - var toc = [WikipediaTOCItem]() - for section in sections { - if let sectionText = section["text"] as? String { - text += sectionText - // The first section (intro) does not have an anchor - if let sectionAnchor = section["anchor"] as? String { - var sectionTitle = (section["line"] as? String ?? "") - sectionTitle = (Wikipedia.sharedFormattingDelegate?.format(context: .tableOfContentsItem, - rawText: sectionTitle, - title: title, - language: language, - isHTML: true)) ?? sectionTitle - let sectionTocLevel = section["toclevel"] as? Int ?? 0 - toc.append(WikipediaTOCItem(title: sectionTitle, anchor: sectionAnchor, tocLevel: sectionTocLevel)) - } - } + if let hatnotes = lead["hatnotes"] as? String { + text += #"
"# + text += hatnotes + text += "
" } - - - var title = title - - var fragment = fragment - - if let redirectedTitle = mobileview["redirected"] as? String { - title = redirectedTitle - if let range = redirectedTitle.range(of: "#") { - // A redirect may contain a fragment (Like #Scroll_Target) - let fragmentRange = Range(uncheckedBounds: (lower: range.lowerBound, upper: redirectedTitle.endIndex)) - fragment = String(redirectedTitle[fragmentRange]) // Fragment from a redirect overwrites the passed fragment - title.removeSubrange(fragmentRange) + + text += leadText + + var toc = [WikipediaTOCItem]() + + if let remaining = dict["remaining"] as? JSONDictionary, + let remainingSections = remaining["sections"] as? [JSONDictionary] { + + for section in remainingSections { + if let sectionText = section["text"] as? String { + // The first section (intro) does not have an anchor + if let sectionAnchor = section["anchor"] as? String { + var sectionTitle = (section["line"] as? String ?? "") + sectionTitle = (Wikipedia.sharedFormattingDelegate?.format(context: .tableOfContentsItem, + rawText: sectionTitle, + title: title, + language: language, + isHTML: true)) ?? sectionTitle + let sectionTocLevel = section["toclevel"] as? Int ?? 1 + toc.append(WikipediaTOCItem(title: sectionTitle, anchor: sectionAnchor, tocLevel: sectionTocLevel)) + + text += "\(sectionTitle)" + } + text += sectionText + } } } - let rawDisplayTitle = (mobileview["displaytitle"] as? String) ?? title + let title = lead["normalizedtitle"] as? String ?? title + + let rawDisplayTitle = (lead["displaytitle"] as? String) ?? title self.init(language: language, title: title, displayTitle: rawDisplayTitle) self.scrollToFragment = fragment - self.rawText = text self.toc = toc - if let imageProperties = mobileview["image"] as? JSONDictionary, - let imageID = imageProperties["file"] as? String { - + if let imageProperties = lead["image"] as? JSONDictionary, + let imageID = imageProperties["file"] as? String, + let thumbs = imageProperties["urls"] as? JSONDictionary { + self.imageID = imageID - } - - if let thumbProperties = mobileview["thumb"] as? JSONDictionary, - let imageURLString = thumbProperties["url"] as? String, - var imageURL = URL(string: imageURLString) { - if var urlComponents = URLComponents(url: imageURL, resolvingAgainstBaseURL: false), - urlComponents.scheme == nil { - urlComponents.scheme = "https" - imageURL = urlComponents.url ?? imageURL + + let availableWidths: [Int] = Array(thumbs.keys).compactMap { return Int($0) }.sorted() + + var bestSize = availableWidths.first ?? imageWidth + for width in availableWidths { + bestSize = width + if width >= imageWidth { + continue + } + } + + if let imageURLString = thumbs["\(bestSize)"] as? String, + let imageURL = URL(string: imageURLString) { + self.imageURL = imageURL } - self.imageURL = imageURL } - - if let languageCount = mobileview["languagecount"] as? Int { + + if let languageCount = lead["languagecount"] as? Int { self.languageCount = languageCount } self.areOtherLanguagesAvailable = languageCount > 0 - if let pageprops = mobileview["pageprops"] as? JSONDictionary, - let wikibaseItem = pageprops["wikibase_item"] as? String { + if let wikibaseItem = lead["wikibase_item"] as? String { self.wikidataID = wikibaseItem } + if let geo = lead["geo"] as? JSONDictionary, + let latitude = geo["latitude"] as? Double, + let longitude = geo["longitude"] as? Double { + self.coordinate = (latitude, longitude) + } } } diff --git a/Sources/WikipediaArticleLanguageLink.swift b/Sources/WikipediaArticleLanguageLink.swift index b5fc5c1..8fe2a9b 100644 --- a/Sources/WikipediaArticleLanguageLink.swift +++ b/Sources/WikipediaArticleLanguageLink.swift @@ -52,7 +52,7 @@ extension WikipediaArticleLanguageLink { let url = URL(string: urlString) else { return nil } - if !WikipediaLanguage.isBlacklisted(languageCode: languageCode) { + if !WikipediaLanguage.isUnsupported(languageCode: languageCode) { let language = WikipediaLanguage(code: languageCode, localizedName: localizedName, autonym: autonym) self.init(language: language, title: title, url: url) } else { diff --git a/Sources/WikipediaArticlePreview.swift b/Sources/WikipediaArticlePreview.swift index d5071e4..a8c8107 100644 --- a/Sources/WikipediaArticlePreview.swift +++ b/Sources/WikipediaArticlePreview.swift @@ -130,23 +130,43 @@ public class WikipediaArticlePreview: Hashable, Equatable { extension WikipediaArticlePreview { convenience init?(jsonDictionary dict: JSONDictionary, language: WikipediaLanguage) { - - guard let title = dict["title"] as? String else { return nil } - + + var title = "" + + if let titlesDict = dict["titles"] as? JSONDictionary, + let normalized = titlesDict["normalized"] as? String { + title = normalized + } else if let t = dict["title"] as? String { + title = t + } + + if title.isEmpty { + return nil + } + let text = dict["extract"] as? String ?? "" self.init(language: language, title: title, text: text) - - if let terms = dict["terms"] as? JSONDictionary, - let descriptions = terms["description"] as? [String] { - let description = descriptions.first ?? "" + + + var description = "" + + if let d = dict["description"] as? String, + !d.isEmpty { + description = d + } else if let terms = dict["terms"] as? JSONDictionary, + let descriptions = terms["description"] as? [String] { + description = descriptions.first ?? "" + } + + if !description.isEmpty { self.description = (Wikipedia.sharedFormattingDelegate?.format(context: .articleDescription, rawText: description, title: title, language: language, isHTML: true)) ?? description } - + if let thumbnail = dict["thumbnail"] as? JSONDictionary, let source = thumbnail["source"] as? String { diff --git a/Sources/WikipediaBlacklistDelegate.swift b/Sources/WikipediaBlacklistDelegate.swift deleted file mode 100644 index 74dbc4e..0000000 --- a/Sources/WikipediaBlacklistDelegate.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// WikipediaBlacklistDelegate.swift -// WikipediaKit -// -// Created by Frank Rausch on 2017-03-22. -// Copyright © 2017 Raureif GmbH / Frank Rausch -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// “Software”), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// - -import Foundation - -public protocol WikipediaBlacklistDelegate: class { - func isBlacklistedForRecommendations(title: String, language: WikipediaLanguage) -> Bool - func containsBlacklistedWords(text: String, language: WikipediaLanguage) -> Bool -} diff --git a/Sources/WikipediaError.swift b/Sources/WikipediaError.swift index 91fc5dc..cea9866 100644 --- a/Sources/WikipediaError.swift +++ b/Sources/WikipediaError.swift @@ -27,36 +27,13 @@ // IN THE SOFTWARE. // - -public func ==(lhs: WikipediaError, rhs: WikipediaError) -> Bool { - switch (lhs, rhs) { - case (.apiError(let a), .apiError(let b)): - return a == b - case (.cancelled, .cancelled): - return true - case (.notFound, .notFound): - return true - case (.noInternetConnection, .noInternetConnection): - return true - case (.notEnoughResults, .notEnoughResults): - return true - case (.decodingError, .decodingError): - return true - case (.badResponse, .badResponse): - return true - case (.other(let a), .other(let b)): - return a == b - default: - return false - } -} - -public enum WikipediaError: Error, Equatable { +public enum WikipediaError: Error, Hashable, Equatable { case apiError(String) case cancelled case notFound case noInternetConnection case notEnoughResults + case noResults case decodingError case badResponse case other(String?) diff --git a/Sources/WikipediaFeatured.swift b/Sources/WikipediaFeatured.swift new file mode 100644 index 0000000..d775cf5 --- /dev/null +++ b/Sources/WikipediaFeatured.swift @@ -0,0 +1,70 @@ +// +// WikipediaFeatured.swift +// WikipediaKit +// +// Created by Frank Rausch on 2020-08-28. +// Copyright © 2020 Raureif GmbH / Frank Rausch +// +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// “Software”), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +import Foundation + +public struct WikipediaFeatured { + public let date: Date + public let language: WikipediaLanguage + + public let articleOfTheDay: WikipediaArticlePreview? + public let mostReadArticles: [WikipediaArticlePreview] +} + +extension WikipediaFeatured { + init?(jsonDictionary dict: JSONDictionary, language: WikipediaLanguage) { + + var articleOfTheDay: WikipediaArticlePreview? + + if let tfa = dict["tfa"] as? JSONDictionary, + let articlePreview = WikipediaArticlePreview(jsonDictionary: tfa, language: language) { + articleOfTheDay = articlePreview + } + + guard let mostRead = dict["mostread"] as? JSONDictionary, + let articles = mostRead["articles"] as? [JSONDictionary] else { + return nil + } + + let dateFormatter = ISO8601DateFormatter() + dateFormatter.formatOptions = .withFullDate + let dateString = mostRead["date"] as? String + let date = dateFormatter.date(from: dateString ?? "") ?? Date() + + var mostReadArticles = [WikipediaArticlePreview]() + + for articleDict in articles { + if let articlePreview = WikipediaArticlePreview(jsonDictionary: articleDict, language: language) { + mostReadArticles.append(articlePreview) + } + } + + self.init(date: date, language: language, articleOfTheDay: articleOfTheDay, mostReadArticles: mostReadArticles) + } +} diff --git a/Sources/WikipediaLanguage.swift b/Sources/WikipediaLanguage.swift index 0dc5710..8e5ff1e 100644 --- a/Sources/WikipediaLanguage.swift +++ b/Sources/WikipediaLanguage.swift @@ -163,15 +163,15 @@ public struct WikipediaLanguage: Hashable, Equatable { "yi" ] - public static func isBlacklisted(languageCode: String) -> Bool { + public static func isUnsupported(languageCode: String) -> Bool { // TODO: Add all languages that are unsupported by the preinstalled OS fonts #if os(iOS) - let languageBlacklist = [ + let unsupportedLanguageCodes = [ "am", "shn", "ti", ] - return languageBlacklist.contains(languageCode) + return unsupportedLanguageCodes.contains(languageCode) #else return false #endif diff --git a/WikipediaKit.xcodeproj/project.pbxproj b/WikipediaKit.xcodeproj/project.pbxproj index 25d83d6..4e70e81 100644 --- a/WikipediaKit.xcodeproj/project.pbxproj +++ b/WikipediaKit.xcodeproj/project.pbxproj @@ -12,6 +12,13 @@ 274062B5210F5E46009808A6 /* Wikipedia+ArticleSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274062B3210F5ADD009808A6 /* Wikipedia+ArticleSummary.swift */; }; 274062B6210F5E46009808A6 /* Wikipedia+ArticleSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274062B3210F5ADD009808A6 /* Wikipedia+ArticleSummary.swift */; }; 274062B7210F5E47009808A6 /* Wikipedia+ArticleSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274062B3210F5ADD009808A6 /* Wikipedia+ArticleSummary.swift */; }; + 27438E1024F948E700658E3B /* WikipediaFeatured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */; }; + 27438E1124F948ED00658E3B /* WikipediaFeatured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */; }; + 27438E1224F948ED00658E3B /* WikipediaFeatured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */; }; + 27438E1324F948EE00658E3B /* WikipediaFeatured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */; }; + 27438E1424F948F800658E3B /* Wikipedia+Featured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */; }; + 27438E1524F948F800658E3B /* Wikipedia+Featured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */; }; + 27438E1624F948F900658E3B /* Wikipedia+Featured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */; }; 274EFCD31EB773200047428B /* WikipediaSearchMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274EFCD21EB773200047428B /* WikipediaSearchMethod.swift */; }; 274EFCD41EB773200047428B /* WikipediaSearchMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274EFCD21EB773200047428B /* WikipediaSearchMethod.swift */; }; 274EFCD51EB773200047428B /* WikipediaSearchMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274EFCD21EB773200047428B /* WikipediaSearchMethod.swift */; }; @@ -22,17 +29,14 @@ 275906081E8301FA000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275906061E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift */; }; 275906091E8301FA000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275906061E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift */; }; 2759060A1E8301FB000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 275906061E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift */; }; - 2759060C1E830237000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */; }; 2759060E1E83025B000C3ACA /* WikipediaNamespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */; }; 2759060F1E830262000C3ACA /* WikipediaNamespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */; }; 275906101E830263000C3ACA /* WikipediaNamespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */; }; 275906111E830263000C3ACA /* WikipediaNamespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */; }; - 275906121E83026C000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */; }; - 275906131E83026D000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */; }; - 275906151E83026E000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */; }; 276D66F01EE9939A007896DC /* Wikipedia+RandomArticles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2721FC321EE86F140025EC74 /* Wikipedia+RandomArticles.swift */; }; 276D66F11EE9939B007896DC /* Wikipedia+RandomArticles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2721FC321EE86F140025EC74 /* Wikipedia+RandomArticles.swift */; }; 276D66F21EE9939C007896DC /* Wikipedia+RandomArticles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2721FC321EE86F140025EC74 /* Wikipedia+RandomArticles.swift */; }; + 278CBB3524F43AE000167272 /* Wikipedia+Featured.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */; }; 27C2AA1C1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C2AA1B1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift */; }; 27C2AA1D1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C2AA1B1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift */; }; 27C2AA1E1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C2AA1B1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift */; }; @@ -64,13 +68,11 @@ 27E3653B1E81987E00F39F78 /* Wikipedia+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */; }; 27E3653D1E8198A800F39F78 /* Wikipedia+Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */; }; 27E3653F1E8198D000F39F78 /* Wikipedia+Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */; }; - 27E365411E81990100F39F78 /* Wikipedia+MostRead.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */; }; 27E3654B1E81AC6A00F39F78 /* WikipediaKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 27E365491E81AC6A00F39F78 /* WikipediaKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27E365511E81AD5300F39F78 /* Wikipedia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365141E81767000F39F78 /* Wikipedia.swift */; }; 27E365521E81AD5300F39F78 /* Wikipedia+Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */; }; 27E365531E81AD5300F39F78 /* Wikipedia+ImageMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365381E81981900F39F78 /* Wikipedia+ImageMeta.swift */; }; 27E365541E81AD5300F39F78 /* Wikipedia+Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */; }; - 27E365551E81AD5300F39F78 /* Wikipedia+MostRead.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */; }; 27E365561E81AD5300F39F78 /* Wikipedia+NearbySearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365361E81975E00F39F78 /* Wikipedia+NearbySearch.swift */; }; 27E365571E81AD5300F39F78 /* Wikipedia+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */; }; 27E365581E81AD5300F39F78 /* WikipediaArticle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365151E81767000F39F78 /* WikipediaArticle.swift */; }; @@ -91,7 +93,6 @@ 27E365941E81C98000F39F78 /* Wikipedia+Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */; }; 27E365951E81C98000F39F78 /* Wikipedia+ImageMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365381E81981900F39F78 /* Wikipedia+ImageMeta.swift */; }; 27E365961E81C98000F39F78 /* Wikipedia+Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */; }; - 27E365971E81C98000F39F78 /* Wikipedia+MostRead.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */; }; 27E365981E81C98000F39F78 /* Wikipedia+NearbySearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365361E81975E00F39F78 /* Wikipedia+NearbySearch.swift */; }; 27E365991E81C98000F39F78 /* Wikipedia+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */; }; 27E3659A1E81C98000F39F78 /* WikipediaArticle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365151E81767000F39F78 /* WikipediaArticle.swift */; }; @@ -111,7 +112,6 @@ 27E365B61E81C9F200F39F78 /* Wikipedia+Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */; }; 27E365B71E81C9F200F39F78 /* Wikipedia+ImageMeta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365381E81981900F39F78 /* Wikipedia+ImageMeta.swift */; }; 27E365B81E81C9F200F39F78 /* Wikipedia+Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */; }; - 27E365B91E81C9F200F39F78 /* Wikipedia+MostRead.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */; }; 27E365BA1E81C9F200F39F78 /* Wikipedia+NearbySearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365361E81975E00F39F78 /* Wikipedia+NearbySearch.swift */; }; 27E365BB1E81C9F200F39F78 /* Wikipedia+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */; }; 27E365BC1E81C9F200F39F78 /* WikipediaArticle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E365151E81767000F39F78 /* WikipediaArticle.swift */; }; @@ -140,13 +140,14 @@ /* Begin PBXFileReference section */ 2721FC321EE86F140025EC74 /* Wikipedia+RandomArticles.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Wikipedia+RandomArticles.swift"; sourceTree = ""; }; 274062B3210F5ADD009808A6 /* Wikipedia+ArticleSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Wikipedia+ArticleSummary.swift"; sourceTree = ""; }; + 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WikipediaFeatured.swift; sourceTree = ""; }; 274EFCD21EB773200047428B /* WikipediaSearchMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaSearchMethod.swift; sourceTree = ""; }; 274EFCDD1EB899E90047428B /* WikipediaKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WikipediaKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 274EFCDF1EB899E90047428B /* WikipediaKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WikipediaKitTests.swift; sourceTree = ""; }; 274EFCE11EB899E90047428B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 275906061E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaTextFormattingDelegate.swift; sourceTree = ""; }; - 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaBlacklistDelegate.swift; sourceTree = ""; }; 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaNamespace.swift; sourceTree = ""; }; + 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Wikipedia+Featured.swift"; sourceTree = ""; }; 27C2AA1B1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaRandomArticlesBuffer.swift; sourceTree = ""; }; 27DFDF811EB271F6005DFA7E /* WikipediaNetworkingActivityDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaNetworkingActivityDelegate.swift; sourceTree = ""; }; 27DFDF861EB4CC9C005DFA7E /* WikipediaTOCItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WikipediaTOCItem.swift; sourceTree = ""; }; @@ -171,7 +172,6 @@ 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Wikipedia+Search.swift"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Wikipedia+Article.swift"; sourceTree = ""; }; 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Wikipedia+Languages.swift"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; - 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Wikipedia+MostRead.swift"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 27E365471E81AC6A00F39F78 /* WikipediaKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WikipediaKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 27E365491E81AC6A00F39F78 /* WikipediaKit-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WikipediaKit-iOS.h"; sourceTree = ""; }; 27E3654A1E81AC6A00F39F78 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -235,7 +235,6 @@ 27DFDF7B1EAE5765005DFA7E /* Protocols */ = { isa = PBXGroup; children = ( - 2759060B1E830237000C3ACA /* WikipediaBlacklistDelegate.swift */, 27DFDF811EB271F6005DFA7E /* WikipediaNetworkingActivityDelegate.swift */, 275906061E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift */, ); @@ -248,9 +247,9 @@ 27E365141E81767000F39F78 /* Wikipedia.swift */, 27E3653C1E8198A800F39F78 /* Wikipedia+Article.swift */, 274062B3210F5ADD009808A6 /* Wikipedia+ArticleSummary.swift */, + 278CBB3424F43AE000167272 /* Wikipedia+Featured.swift */, 27E365381E81981900F39F78 /* Wikipedia+ImageMeta.swift */, 27E3653E1E8198D000F39F78 /* Wikipedia+Languages.swift */, - 27E365401E81990100F39F78 /* Wikipedia+MostRead.swift */, 27E365361E81975E00F39F78 /* Wikipedia+NearbySearch.swift */, 2721FC321EE86F140025EC74 /* Wikipedia+RandomArticles.swift */, 27E3653A1E81987E00F39F78 /* Wikipedia+Search.swift */, @@ -331,6 +330,7 @@ 27E365171E81767000F39F78 /* WikipediaArticleLanguageLink.swift */, 27E365181E81767000F39F78 /* WikipediaArticlePreview.swift */, 27E3651A1E81767000F39F78 /* WikipediaError.swift */, + 27438E0F24F948E700658E3B /* WikipediaFeatured.swift */, 27E3651C1E81767000F39F78 /* WikipediaImage.swift */, 27E3651D1E81767000F39F78 /* WikipediaLanguage.swift */, 2759060D1E83025B000C3ACA /* WikipediaNamespace.swift */, @@ -496,7 +496,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1220; ORGANIZATIONNAME = "Frank Rausch"; TargetAttributes = { 274EFCDC1EB899E90047428B = { @@ -600,6 +600,7 @@ buildActionMask = 2147483647; files = ( 274EFCD31EB773200047428B /* WikipediaSearchMethod.swift in Sources */, + 27438E1024F948E700658E3B /* WikipediaFeatured.swift in Sources */, 27E365371E81975E00F39F78 /* Wikipedia+NearbySearch.swift in Sources */, 27E365271E81767000F39F78 /* WikipediaError.swift in Sources */, 275906071E8301F6000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */, @@ -620,13 +621,12 @@ 27E365241E81767000F39F78 /* WikipediaArticleLanguageLink.swift in Sources */, 27E365211E81767000F39F78 /* Wikipedia.swift in Sources */, 27E365291E81767000F39F78 /* WikipediaImage.swift in Sources */, - 27E365411E81990100F39F78 /* Wikipedia+MostRead.swift in Sources */, - 2759060C1E830237000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */, 27E365391E81981900F39F78 /* Wikipedia+ImageMeta.swift in Sources */, 27E3653B1E81987E00F39F78 /* Wikipedia+Search.swift in Sources */, 27E3653F1E8198D000F39F78 /* Wikipedia+Languages.swift in Sources */, 27E365251E81767000F39F78 /* WikipediaArticlePreview.swift in Sources */, 27E365311E8177A800F39F78 /* String+Wikipedia.swift in Sources */, + 278CBB3524F43AE000167272 /* Wikipedia+Featured.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -634,14 +634,14 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 27438E1124F948ED00658E3B /* WikipediaFeatured.swift in Sources */, 274EFCD41EB773200047428B /* WikipediaSearchMethod.swift in Sources */, 27E365571E81AD5300F39F78 /* Wikipedia+Search.swift in Sources */, - 27E365551E81AD5300F39F78 /* Wikipedia+MostRead.swift in Sources */, 275906081E8301FA000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */, 27E365641E81AD5700F39F78 /* String+Wikipedia.swift in Sources */, 274062B5210F5E46009808A6 /* Wikipedia+ArticleSummary.swift in Sources */, - 275906151E83026E000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */, 27E365521E81AD5300F39F78 /* Wikipedia+Article.swift in Sources */, + 27438E1424F948F800658E3B /* Wikipedia+Featured.swift in Sources */, 27C2AA1D1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */, 2759060F1E830262000C3ACA /* WikipediaNamespace.swift in Sources */, 27E3655E1E81AD5300F39F78 /* WikipediaLanguage.swift in Sources */, @@ -669,21 +669,21 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 27438E1224F948ED00658E3B /* WikipediaFeatured.swift in Sources */, 274EFCD51EB773200047428B /* WikipediaSearchMethod.swift in Sources */, 27E365A21E81C98000F39F78 /* WikipediaError.swift in Sources */, 27E365951E81C98000F39F78 /* Wikipedia+ImageMeta.swift in Sources */, 275906091E8301FA000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */, 27E365A51E81C98400F39F78 /* String+Wikipedia.swift in Sources */, 274062B6210F5E46009808A6 /* Wikipedia+ArticleSummary.swift in Sources */, - 275906131E83026D000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */, 27E365991E81C98000F39F78 /* Wikipedia+Search.swift in Sources */, + 27438E1524F948F800658E3B /* Wikipedia+Featured.swift in Sources */, 27C2AA1E1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */, 275906101E830263000C3ACA /* WikipediaNamespace.swift in Sources */, 27E365981E81C98000F39F78 /* Wikipedia+NearbySearch.swift in Sources */, 27E365941E81C98000F39F78 /* Wikipedia+Article.swift in Sources */, 27E3659F1E81C98000F39F78 /* WikipediaSearchResults.swift in Sources */, 27E3659C1E81C98000F39F78 /* WikipediaArticlePreview.swift in Sources */, - 27E365971E81C98000F39F78 /* Wikipedia+MostRead.swift in Sources */, 27E365961E81C98000F39F78 /* Wikipedia+Languages.swift in Sources */, 27DFDF891EB4CC9C005DFA7E /* WikipediaTOCItem.swift in Sources */, 276D66F11EE9939B007896DC /* Wikipedia+RandomArticles.swift in Sources */, @@ -704,21 +704,21 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 27438E1324F948EE00658E3B /* WikipediaFeatured.swift in Sources */, 274EFCD61EB773200047428B /* WikipediaSearchMethod.swift in Sources */, 27E365C41E81C9F200F39F78 /* WikipediaError.swift in Sources */, 27E365B71E81C9F200F39F78 /* Wikipedia+ImageMeta.swift in Sources */, 2759060A1E8301FB000C3ACA /* WikipediaTextFormattingDelegate.swift in Sources */, 27E365C71E81C9F500F39F78 /* String+Wikipedia.swift in Sources */, 274062B7210F5E47009808A6 /* Wikipedia+ArticleSummary.swift in Sources */, - 275906121E83026C000C3ACA /* WikipediaBlacklistDelegate.swift in Sources */, 27E365BB1E81C9F200F39F78 /* Wikipedia+Search.swift in Sources */, + 27438E1624F948F900658E3B /* Wikipedia+Featured.swift in Sources */, 27C2AA1F1EF5249600288BEA /* WikipediaRandomArticlesBuffer.swift in Sources */, 275906111E830263000C3ACA /* WikipediaNamespace.swift in Sources */, 27E365BA1E81C9F200F39F78 /* Wikipedia+NearbySearch.swift in Sources */, 27E365B61E81C9F200F39F78 /* Wikipedia+Article.swift in Sources */, 27E365C11E81C9F200F39F78 /* WikipediaSearchResults.swift in Sources */, 27E365BE1E81C9F200F39F78 /* WikipediaArticlePreview.swift in Sources */, - 27E365B91E81C9F200F39F78 /* Wikipedia+MostRead.swift in Sources */, 27E365B81E81C9F200F39F78 /* Wikipedia+Languages.swift in Sources */, 27DFDF8A1EB4CC9C005DFA7E /* WikipediaTOCItem.swift in Sources */, 276D66F21EE9939C007896DC /* Wikipedia+RandomArticles.swift in Sources */, @@ -801,6 +801,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -810,6 +811,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -861,6 +863,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -870,6 +873,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -902,8 +906,8 @@ INFOPLIST_FILE = WikipediaKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - MARKETING_VERSION = 2.0.7; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.macos; PRODUCT_NAME = WikipediaKit; SKIP_INSTALL = YES; @@ -926,8 +930,8 @@ INFOPLIST_FILE = WikipediaKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - MARKETING_VERSION = 2.0.7; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.macos; PRODUCT_NAME = WikipediaKit; SKIP_INSTALL = YES; @@ -947,9 +951,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "WikipediaKit-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit; PRODUCT_NAME = WikipediaKit; SDKROOT = iphoneos; @@ -970,9 +974,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "WikipediaKit-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit; PRODUCT_NAME = WikipediaKit; SDKROOT = iphoneos; @@ -995,7 +999,7 @@ INFOPLIST_FILE = "WikipediaKit-watchOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.watchos; PRODUCT_NAME = WikipediaKit; SDKROOT = watchos; @@ -1018,7 +1022,7 @@ INFOPLIST_FILE = "WikipediaKit-watchOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.watchos; PRODUCT_NAME = WikipediaKit; SDKROOT = watchos; @@ -1041,14 +1045,14 @@ INFOPLIST_FILE = "WikipediaKit-tvOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.tvos; PRODUCT_NAME = WikipediaKit; SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -1063,14 +1067,14 @@ INFOPLIST_FILE = "WikipediaKit-tvOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.0.7; + MARKETING_VERSION = 3.0; PRODUCT_BUNDLE_IDENTIFIER = net.raureif.WikipediaKit.tvos; PRODUCT_NAME = WikipediaKit; SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/WikipediaKit.xcodeproj/xcshareddata/xcschemes/WikipediaKit-iOS.xcscheme b/WikipediaKit.xcodeproj/xcshareddata/xcschemes/WikipediaKit-iOS.xcscheme index e76645a..31103b4 100644 --- a/WikipediaKit.xcodeproj/xcshareddata/xcschemes/WikipediaKit-iOS.xcscheme +++ b/WikipediaKit.xcodeproj/xcshareddata/xcschemes/WikipediaKit-iOS.xcscheme @@ -1,6 +1,6 @@