diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index a230c84c..51f45890 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ - **What is your app's Bundle ID?**: - **When was the latest version of your app published to the App Store?**: - **Is your app published in the US App Store? If not, what App Store is it published in?**: -- **Does Siren work if you plugin your app's BundleID (and CountryCode, if necessary) into the Example App?**: +- **Does Siren work if you plugin your app's `BundleID` (and `countryCode`, if necessary) into the Example app?**: --- diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 25c81fe3..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -ruby-2.5.1 \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml index 4b98e5a3..027a24a0 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,13 +5,11 @@ included: disabled_rules: - cyclomatic_complexity + - line_length - nesting - unused_optional_binding - variable_name # Specialized Rules file_length: - - 1000 - -line_length: - - 200 + - 500 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100755 index d07f23f7..00000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,83 +0,0 @@ -### Creators -[Arthur Ariel Sabintsev](http://www.sabintsev.com/) and [Aaron Brager](https://twitter.com/GetAaron) - -### Siren Project Contributors -- [Dmitry Bespalov](https://github.com/diamondsky) for [Pull Request #7](https://github.com/ArtSabintsev/Siren/pull/7) -- [Daniel Bauke](https://github.com/bonkey) for [Pull Request #8](https://github.com/ArtSabintsev/Siren/pull/8) -- [ipedro](https://github.com/ipedro) for [Pull Request #76 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/76) -- [Michael Graff](https://github.com/skandragon) for [Pull Request #15](https://github.com/ArtSabintsev/Siren/pull/15) -- [Jaroslav_](https://github.com/jaroslavas) for [Pull Request #83 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/83) -- [Dylan Bettermann](https://github.com/dbettermann) for [Pull Request #18](https://github.com/ArtSabintsev/Siren/pull/18) -- [Daniel](https://github.com/Daniel) for [Pull Request #21](https://github.com/ArtSabintsev/Siren/pull/21) -- [nagaho](https://github.com/nagaho) for [Pull Request #22](https://github.com/ArtSabintsev/Siren/pull/22) -- [Parnsind Hantrakool](https://github.com/kong707) for [Pull Request #91 (Harpy)](https://github.com/ArtSabintsev/Harpy/issues/91) -- [Tibor Molnár](https://github.com/fatalaa) for [Pull Request #96 (Harpy)](https://github.com/ArtSabintsev/Harpy/issues/96) -- [Tanel Suurhans](https://github.com/tanelsuurhans) and [Jaroslav_](https://github.com/jaroslavas) for [Pull Request #99 (Harpy)](https://github.com/ArtSabintsev/Harpy/issues/99) -- [Zaid M. Said](https://github.com/SentulAsia) for [Pull Request #36](https://github.com/ArtSabintsev/Siren/pull/36) -- [Vahan Margaryan](https://github.com/VahanMargaryan) for [Pull Request #37](https://github.com/ArtSabintsev/Siren/pull/37) -- [Justus Kandzi](https://github.com/jkandzi) for [Pull Request #108 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/108) -- [Maxim-Inv](https://github.com/Maxim-Inv) for [Pull Request #40](https://github.com/ArtSabintsev/Siren/pull/40) -- [Dirk van Oosterbosch](https://github.com/irlabs) for [Pull Request #54](https://github.com/ArtSabintsev/Siren/pull/54) and [Pull Request #55](https://github.com/ArtSabintsev/Siren/pull/55) -- [pavankataria](https://github.com/pavankataria) for [Pull Request #63](https://github.com/ArtSabintsev/Siren/pull/63) -- [attilat85](https://github.com/attilat85) for [Pull Request #124 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/124) -- [Vahan Margaryan](https://github.com/VahanMargaryan) for [Pull Request #71](https://github.com/ArtSabintsev/Siren/pull/71) -- [Josip Injic](https://github.com/jinjic) for [Pull Request #73](https://github.com/ArtSabintsev/Siren/pull/73) -- [Thi](https://github.com/thii) for [Pull Request #78](https://github.com/ArtSabintsev/Siren/pull/78) -- [Ilija Puaca](https://github.com/ilijapuaca) for [Pull Request #141 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/141) -- [thii](https://github.com/ilijapuaca) for [Pull Request #83](https://github.com/ArtSabintsev/Siren/pull/83) -- [Kristaps Grinbergs](https://github.com/fassko) for [Pull Request #90](https://github.com/ArtSabintsev/Siren/pull/90) -- [Luciano Nascimento](https://github.com/@lucianocn) for [Pull Request #146 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/146) -- [Stefan Kieleithner](https://github.com/steviki) for [Pull Request #97](https://github.com/ArtSabintsev/Siren/pull/97) -- [Vladislav Jevremović](https://github.com/VladislavJevremovic) for [Pull Request #98](https://github.com/ArtSabintsev/Siren/pull/98) -- [Stefan Kieleithner](https://github.com/steviki) for [Pull Request #99](https://github.com/ArtSabintsev/Siren/pull/99) -- [Konstantinos N.](https://github.com/kwstasna) for [Pull Request #101](https://github.com/ArtSabintsev/Siren/pull/101) -- [Christoph Mantler](https://github.com/ChrisixFlash) for [Pull Request #103](https://github.com/ArtSabintsev/Siren/pull/103) and [Pull Request #106](https://github.com/ArtSabintsev/Siren/pull/106) -- [xedla](https://github.com/xedla) for [Pull Request #107](https://github.com/ArtSabintsev/Siren/pull/107) -- [Daniel Hu](https://github.com/zongmumask) for [Pull Request #116](https://github.com/ArtSabintsev/Siren/pull/116) -- [Jakob Krigovsky](https://github.com/sonicdoe) for [Pull Request #118](https://github.com/ArtSabintsev/Siren/pull/118) -- [germ4n](https://github.com/glm4) for [Pull Request #122](https://github.com/ArtSabintsev/Siren/pull/122) -- [Txai Wieser](https://github.com/txaiwieser) for [Pull Request #139](https://github.com/ArtSabintsev/Siren/pull/139) and [Pull Request #140](https://github.com/ArtSabintsev/Siren/pull/140) -- [premyslvlcek](https://github.com/premyslvlcek) for [Pull Request #143](https://github.com/ArtSabintsev/Siren/pull/143) -- [Seyed Mojtaba Hosseini Zeidabadi](https://github.com/MojtabaHs) for [Pull Request #144](https://github.com/ArtSabintsev/Siren/pull/143) -- [Chanchal Raj](https://github.com/RajChanchal) for [Pull Request #171 (Harpy)](https://github.com/ArtSabintsev/harpy/pull/171) -- [Ryoh Tsukahara](https://github.com/nixnoughtnothing) for [Pull Request #150](https://github.com/ArtSabintsev/Siren/pull/150) and [Pull Request #159](https://github.com/ArtSabintsev/Siren/pull/159) -- [Jason Wade](https://github.com/iJasonWade) for [Pull Request #162](https://github.com/ArtSabintsev/Siren/pull/162) -- [JussiSuojanen](https://github.com/JussiSuojanen) for [Pull Request #171](https://github.com/ArtSabintsev/Siren/pull/171) -- [Dmytro Cheverda](https://github.com/dimacheverda) for [Pull Request #175](https://github.com/ArtSabintsev/Siren/pull/175) -- [Vladislav Jevremovic](https://github.com/VladislavJevremovic) for [Pull Request #176](https://github.com/ArtSabintsev/Siren/pull/176) -- [NSemakov](https://github.com/NSemakov) for [Pull Request #179](https://github.com/ArtSabintsev/Siren/pull/179) -- [Attia Mo](https://github.com/attiamo) for [Pull Request #182](https://github.com/ArtSabintsev/Siren/pull/182) -- [wbison](https://github.com/wbison) for [Pull Request #185 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/185) -- [Balázs Vincze](https://github.com/vinczebalazs) for [Pull Request #200](https://github.com/ArtSabintsev/siren/pull/200) -- [Txai Wieser](https://github.com/txaiwieser) for [Pull Request #201](https://github.com/ArtSabintsev/siren/pull/200) -- [Gabriel Martelo](https://github.com/gabmarfer) for [Pull Request #214](https://github.com/ArtSabintsev/Siren/pull/214) -- [Ryan](ryanthon) for [Pull Request #216](https://github.com/ArtSabintsev/Siren/pull/216) -- [Titouan Van Belle](TitouanVanBelle) for [Pull Request #218](https://github.com/ArtSabintsev/Siren/pull/218) -- [Ilija Puaca](https://github.com/ilijapuaca) for [Pull Request #247](https://github.com/ArtSabintsev/Siren/pull/247) - -### Harpy Project Contributors -This repo is a Swift language port of [Harpy](https://github.com/ArtSabintsev/Harpy). We couldn't have built this port without acknowledging the following developers who were instrumental in getting Harpy to v3.2.1, the version of Harpy that Siren was based on. - -A huge **Thank You** to the following developers: - -- [Borut Tomažin](https://github.com/borut-t) -- [Bertie Liu](https://github.com/https://github.com/aceisScope) -- [Burakkilic](https://github.com/burakkilic) -- [Claas Lange](https://github.com/claaslange) -- [Daniel](https://github.com/danieltskv) -- [David Keegan](https://github.com/kgn) -- [Erick](https://github.com/dexcell0) -- [Ercillagorka](https://github.com/ercillagorka) -- [Jamie Ly](https://github,com/jamiely) -- [Jon Andersen](https://github.com/jonandersen) -- [Josh T. Brown](https://github.com/joshuatbrown) -- [Mark Rickert](https://github.com/markrickert) -- [Patrick Debois](https://github.com/jedi4ever) -- [Pius Uzamere](https://github.com/pius) -- [Rahul Jiresal](https://github.com/rahuljiresal) -- [Rui Peres](https://github.com/RuiAAPeres) -- [Thomas Hempel](https://github.com/thomashempel) -- [TrentW](https://github.com/trentw) - -### Special Thanks -Finally, a massive **Thank You** to [Aaron Brager](https://twitter.com/GetAaron) for the dev-work and issue-moderation he's done on Harpy since 2012. A Swift port could not have happened without him. diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index c80f0b82..f0cc2b65 100755 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -7,29 +7,33 @@ objects = { /* Begin PBXBuildFile section */ + 4D729C4421A20EDC002F73AB /* Siren.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 55EC365E1E6BB99B00726F13 /* Siren.bundle */; }; + 4D729C4621A213B4002F73AB /* Rules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D729C4521A213B4002F73AB /* Rules.swift */; }; 55EC364B1E6BB98A00726F13 /* Siren.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC36491E6BB98A00726F13 /* Siren.h */; settings = {ATTRIBUTES = (Public, ); }; }; 55EC36601E6BB99B00726F13 /* Siren.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 55EC365E1E6BB99B00726F13 /* Siren.bundle */; }; 55EC36611E6BB99B00726F13 /* Siren.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55EC365F1E6BB99B00726F13 /* Siren.swift */; }; + 8E01817921B379AF006DED05 /* Results.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E01817821B379AF006DED05 /* Results.swift */; }; + 8E01817E21B379DD006DED05 /* PresentationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E01817B21B379DD006DED05 /* PresentationManager.swift */; }; + 8E01818021B379DD006DED05 /* RulesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E01817D21B379DD006DED05 /* RulesManager.swift */; }; + 8E01818221B37B43006DED05 /* AlertAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E01818121B37B43006DED05 /* AlertAction.swift */; }; 8E1635A91E6A0B9C0060CE27 /* SirenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */; }; - 8E171DDE215B26B4006FBBCC /* SirenBundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD1215B26B4006FBBCC /* SirenBundleExtension.swift */; }; - 8E171DDF215B26B4006FBBCC /* SirenDateExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD2215B26B4006FBBCC /* SirenDateExtension.swift */; }; - 8E171DE1215B26B4006FBBCC /* SirenAlertMessaging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD6215B26B4006FBBCC /* SirenAlertMessaging.swift */; }; - 8E171DE2215B26B4006FBBCC /* SirenLookupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD7215B26B4006FBBCC /* SirenLookupModel.swift */; }; - 8E171DE3215B26B4006FBBCC /* SirenUIAlertControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD8215B26B4006FBBCC /* SirenUIAlertControllerExtension.swift */; }; + 8E171DDE215B26B4006FBBCC /* BundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD1215B26B4006FBBCC /* BundleExtension.swift */; }; + 8E171DDF215B26B4006FBBCC /* DateExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD2215B26B4006FBBCC /* DateExtension.swift */; }; + 8E171DE2215B26B4006FBBCC /* LookupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD7215B26B4006FBBCC /* LookupModel.swift */; }; + 8E171DE3215B26B4006FBBCC /* UIAlertControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD8215B26B4006FBBCC /* UIAlertControllerExtension.swift */; }; 8E171DE4215B26B4006FBBCC /* SirenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DDA215B26B4006FBBCC /* SirenViewController.swift */; }; - 8E171DE6215B2701006FBBCC /* SirenLocalizationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DE5215B2701006FBBCC /* SirenLocalizationExtension.swift */; }; - 8E171DEE215B2D09006FBBCC /* SirenUserDefaultsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DED215B2D09006FBBCC /* SirenUserDefaultsExtension.swift */; }; + 8E171DE6215B2701006FBBCC /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DE5215B2701006FBBCC /* Localization.swift */; }; + 8E171DEE215B2D09006FBBCC /* UserDefaultsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DED215B2D09006FBBCC /* UserDefaultsExtension.swift */; }; + 8E5061EB21C9CDF000A28DE0 /* AlertConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E5061EA21C9CDF000A28DE0 /* AlertConstants.swift */; }; 8E641D2520C8B44B00908555 /* Siren.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EC36471E6BB98A00726F13 /* Siren.framework */; }; 8EACA9711F380294003134CA /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA9671F37F2D3003134CA /* LaunchScreen.xib */; }; 8EACA9721F380294003134CA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA9691F37F2D3003134CA /* Main.storyboard */; }; 8EACA9731F380294003134CA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA96B1F37F2D3003134CA /* Images.xcassets */; }; 8EACA9741F38029B003134CA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EACA9661F37F2D3003134CA /* AppDelegate.swift */; }; 8EACA9751F38029B003134CA /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EACA96D1F37F2D3003134CA /* ViewController.swift */; }; - 8ED733FC215DBE4900447E3B /* SirenDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DD4215B26B4006FBBCC /* SirenDelegate.swift */; }; - 8ED733FD215DBE4900447E3B /* SirenConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DE7215B27C2006FBBCC /* SirenConstants.swift */; }; - 8ED733FE215DBE4900447E3B /* SirenError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DCD215B26B4006FBBCC /* SirenError.swift */; }; - 8ED733FF215DBE4900447E3B /* SirenLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DCE215B26B4006FBBCC /* SirenLog.swift */; }; - 8ED73400215DBE4900447E3B /* SirenHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E171DEB215B28EC006FBBCC /* SirenHelpers.swift */; }; + 8EE1FAF321B4DC0F009112A8 /* KnownError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE1FAF221B4DC0F009112A8 /* KnownError.swift */; }; + 8EE1FAF521B4E6B8009112A8 /* APIManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE1FAF421B4E6B8009112A8 /* APIManager.swift */; }; + 8EEF4AB121AA6DDF00C83AAA /* DataParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EEF4AB021AA6DDF00C83AAA /* DataParser.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -43,25 +47,25 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 4D729C4521A213B4002F73AB /* Rules.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rules.swift; sourceTree = ""; }; 55EC36471E6BB98A00726F13 /* Siren.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Siren.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55EC36491E6BB98A00726F13 /* Siren.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Siren.h; sourceTree = ""; }; 55EC364A1E6BB98A00726F13 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../Siren/Info.plist; sourceTree = ""; }; 55EC365E1E6BB99B00726F13 /* Siren.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Siren.bundle; path = ../../Sources/Siren.bundle; sourceTree = ""; }; 55EC365F1E6BB99B00726F13 /* Siren.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Siren.swift; path = ../../Sources/Siren.swift; sourceTree = ""; }; - 8E171DCD215B26B4006FBBCC /* SirenError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenError.swift; sourceTree = ""; }; - 8E171DCE215B26B4006FBBCC /* SirenLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenLog.swift; sourceTree = ""; }; - 8E171DD1215B26B4006FBBCC /* SirenBundleExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenBundleExtension.swift; sourceTree = ""; }; - 8E171DD2215B26B4006FBBCC /* SirenDateExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenDateExtension.swift; sourceTree = ""; }; - 8E171DD4215B26B4006FBBCC /* SirenDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenDelegate.swift; sourceTree = ""; }; - 8E171DD6215B26B4006FBBCC /* SirenAlertMessaging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenAlertMessaging.swift; sourceTree = ""; }; - 8E171DD7215B26B4006FBBCC /* SirenLookupModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenLookupModel.swift; sourceTree = ""; }; - 8E171DD8215B26B4006FBBCC /* SirenUIAlertControllerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenUIAlertControllerExtension.swift; sourceTree = ""; }; + 8E01817821B379AF006DED05 /* Results.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Results.swift; sourceTree = ""; }; + 8E01817B21B379DD006DED05 /* PresentationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentationManager.swift; sourceTree = ""; }; + 8E01817D21B379DD006DED05 /* RulesManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RulesManager.swift; sourceTree = ""; }; + 8E01818121B37B43006DED05 /* AlertAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertAction.swift; sourceTree = ""; }; + 8E171DD1215B26B4006FBBCC /* BundleExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BundleExtension.swift; sourceTree = ""; }; + 8E171DD2215B26B4006FBBCC /* DateExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateExtension.swift; sourceTree = ""; }; + 8E171DD7215B26B4006FBBCC /* LookupModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LookupModel.swift; sourceTree = ""; }; + 8E171DD8215B26B4006FBBCC /* UIAlertControllerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAlertControllerExtension.swift; sourceTree = ""; }; 8E171DDA215B26B4006FBBCC /* SirenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenViewController.swift; sourceTree = ""; }; - 8E171DE5215B2701006FBBCC /* SirenLocalizationExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SirenLocalizationExtension.swift; sourceTree = ""; }; - 8E171DE7215B27C2006FBBCC /* SirenConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SirenConstants.swift; sourceTree = ""; }; - 8E171DEB215B28EC006FBBCC /* SirenHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SirenHelpers.swift; sourceTree = ""; }; - 8E171DED215B2D09006FBBCC /* SirenUserDefaultsExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SirenUserDefaultsExtension.swift; sourceTree = ""; }; + 8E171DE5215B2701006FBBCC /* Localization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localization.swift; sourceTree = ""; }; + 8E171DED215B2D09006FBBCC /* UserDefaultsExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsExtension.swift; sourceTree = ""; }; 8E3A6C041D07CB6F00A8B7CF /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8E5061EA21C9CDF000A28DE0 /* AlertConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertConstants.swift; sourceTree = ""; }; 8EACA9661F37F2D3003134CA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 8EACA9681F37F2D3003134CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 8EACA96A1F37F2D3003134CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -69,8 +73,11 @@ 8EACA96C1F37F2D3003134CA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8EACA96D1F37F2D3003134CA /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 8EC391811A58B465001C121E /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8EE1FAF221B4DC0F009112A8 /* KnownError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KnownError.swift; sourceTree = ""; }; + 8EE1FAF421B4E6B8009112A8 /* APIManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIManager.swift; sourceTree = ""; }; 8EE6C74B1E6A0AE100DBE454 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenTests.swift; sourceTree = ""; }; + 8EEF4AB021AA6DDF00C83AAA /* DataParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataParser.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -106,21 +113,30 @@ 55EC365F1E6BB99B00726F13 /* Siren.swift */, 55EC365E1E6BB99B00726F13 /* Siren.bundle */, 8E171DD0215B26B4006FBBCC /* Extensions */, + 8E01817A21B379DD006DED05 /* Managers */, 8E171DD5215B26B4006FBBCC /* Models */, - 8E171DD3215B26B4006FBBCC /* Protocols */, 8E171DCC215B26B4006FBBCC /* Utilities */, 8E171DD9215B26B4006FBBCC /* View Controllers */, ); path = Siren; sourceTree = ""; }; + 8E01817A21B379DD006DED05 /* Managers */ = { + isa = PBXGroup; + children = ( + 8EE1FAF421B4E6B8009112A8 /* APIManager.swift */, + 8E01817B21B379DD006DED05 /* PresentationManager.swift */, + 8E01817D21B379DD006DED05 /* RulesManager.swift */, + ); + name = Managers; + path = ../../Sources/Managers; + sourceTree = ""; + }; 8E171DCC215B26B4006FBBCC /* Utilities */ = { isa = PBXGroup; children = ( - 8E171DE7215B27C2006FBBCC /* SirenConstants.swift */, - 8E171DCD215B26B4006FBBCC /* SirenError.swift */, - 8E171DCE215B26B4006FBBCC /* SirenLog.swift */, - 8E171DEB215B28EC006FBBCC /* SirenHelpers.swift */, + 8EEF4AB021AA6DDF00C83AAA /* DataParser.swift */, + 8EE1FAF221B4DC0F009112A8 /* KnownError.swift */, ); name = Utilities; path = ../../Sources/Utilities; @@ -129,30 +145,24 @@ 8E171DD0215B26B4006FBBCC /* Extensions */ = { isa = PBXGroup; children = ( - 8E171DD1215B26B4006FBBCC /* SirenBundleExtension.swift */, - 8E171DD2215B26B4006FBBCC /* SirenDateExtension.swift */, - 8E171DE5215B2701006FBBCC /* SirenLocalizationExtension.swift */, - 8E171DD8215B26B4006FBBCC /* SirenUIAlertControllerExtension.swift */, - 8E171DED215B2D09006FBBCC /* SirenUserDefaultsExtension.swift */, + 8E171DD1215B26B4006FBBCC /* BundleExtension.swift */, + 8E171DD2215B26B4006FBBCC /* DateExtension.swift */, + 8E171DD8215B26B4006FBBCC /* UIAlertControllerExtension.swift */, + 8E171DED215B2D09006FBBCC /* UserDefaultsExtension.swift */, ); name = Extensions; path = ../../Sources/Extensions; sourceTree = ""; }; - 8E171DD3215B26B4006FBBCC /* Protocols */ = { - isa = PBXGroup; - children = ( - 8E171DD4215B26B4006FBBCC /* SirenDelegate.swift */, - ); - name = Protocols; - path = ../../Sources/Protocols; - sourceTree = ""; - }; 8E171DD5215B26B4006FBBCC /* Models */ = { isa = PBXGroup; children = ( - 8E171DD6215B26B4006FBBCC /* SirenAlertMessaging.swift */, - 8E171DD7215B26B4006FBBCC /* SirenLookupModel.swift */, + 8E01818121B37B43006DED05 /* AlertAction.swift */, + 8E5061EA21C9CDF000A28DE0 /* AlertConstants.swift */, + 8E171DE5215B2701006FBBCC /* Localization.swift */, + 8E171DD7215B26B4006FBBCC /* LookupModel.swift */, + 8E01817821B379AF006DED05 /* Results.swift */, + 4D729C4521A213B4002F73AB /* Rules.swift */, ); name = Models; path = ../../Sources/Models; @@ -367,6 +377,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4D729C4421A20EDC002F73AB /* Siren.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -404,20 +415,23 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8E171DE1215B26B4006FBBCC /* SirenAlertMessaging.swift in Sources */, - 8E171DEE215B2D09006FBBCC /* SirenUserDefaultsExtension.swift in Sources */, - 8E171DE2215B26B4006FBBCC /* SirenLookupModel.swift in Sources */, - 8ED73400215DBE4900447E3B /* SirenHelpers.swift in Sources */, + 8E01818021B379DD006DED05 /* RulesManager.swift in Sources */, + 8E01818221B37B43006DED05 /* AlertAction.swift in Sources */, + 8E171DEE215B2D09006FBBCC /* UserDefaultsExtension.swift in Sources */, + 8E171DE2215B26B4006FBBCC /* LookupModel.swift in Sources */, 55EC36611E6BB99B00726F13 /* Siren.swift in Sources */, - 8ED733FC215DBE4900447E3B /* SirenDelegate.swift in Sources */, - 8ED733FF215DBE4900447E3B /* SirenLog.swift in Sources */, + 8E5061EB21C9CDF000A28DE0 /* AlertConstants.swift in Sources */, + 8E01817921B379AF006DED05 /* Results.swift in Sources */, + 8EEF4AB121AA6DDF00C83AAA /* DataParser.swift in Sources */, + 4D729C4621A213B4002F73AB /* Rules.swift in Sources */, 8E171DE4215B26B4006FBBCC /* SirenViewController.swift in Sources */, - 8E171DE6215B2701006FBBCC /* SirenLocalizationExtension.swift in Sources */, - 8E171DDE215B26B4006FBBCC /* SirenBundleExtension.swift in Sources */, - 8ED733FD215DBE4900447E3B /* SirenConstants.swift in Sources */, - 8E171DE3215B26B4006FBBCC /* SirenUIAlertControllerExtension.swift in Sources */, - 8ED733FE215DBE4900447E3B /* SirenError.swift in Sources */, - 8E171DDF215B26B4006FBBCC /* SirenDateExtension.swift in Sources */, + 8E171DE6215B2701006FBBCC /* Localization.swift in Sources */, + 8EE1FAF521B4E6B8009112A8 /* APIManager.swift in Sources */, + 8E171DDE215B26B4006FBBCC /* BundleExtension.swift in Sources */, + 8E01817E21B379DD006DED05 /* PresentationManager.swift in Sources */, + 8E171DE3215B26B4006FBBCC /* UIAlertControllerExtension.swift in Sources */, + 8EE1FAF321B4DC0F009112A8 /* KnownError.swift in Sources */, + 8E171DDF215B26B4006FBBCC /* DateExtension.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift index a7e8177e..82132f2c 100755 --- a/Example/Example/AppDelegate.swift +++ b/Example/Example/AppDelegate.swift @@ -6,108 +6,237 @@ // Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved. // -import UIKit import Siren +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { window?.makeKeyAndVisible() - setupSiren() + /// - Warning: + /// Siren should ONLY be placed in UIApplication.didFinishLaunchingWithOptionsand only after the `window?.makeKeyAndVisible()` call. + /// Siren initializes a listener on `didBecomeActiveNotification` to perform version checks. + +// defaultExample() + defaultExampleUsingCompletionHandler() +// minimalCustomizationPresentationExample() +// forceLocalizationCustomizationPresentationExample() +// customMessagingPresentationExample() +// annoyingRuleExample() +// hyperCriticalRulesExample() +// updateSpecificRulesExample() +// customAlertRulesExample() +// appStoreCountryChangeExample() +// complexExample() return true } - - func setupSiren() { - let siren = Siren.shared - - // Optional - siren.delegate = self - - // Optional - siren.debugEnabled = true - - // Optional - Change the name of your app. Useful if you have a long app name and want to display a shortened version in the update dialog (e.g., the UIAlertController). -// siren.appName = "Test App Name" - - // Optional - Change the various UIAlertController and UIAlertAction messaging. One or more values can be changes. If only a subset of values are changed, the defaults with which Siren comes with will be used. -// siren.alertMessaging = SirenAlertMessaging(updateTitle: NSAttributedString(string: "New Fancy Title"), -// updateMessage: NSAttributedString(string: "New message goes here!"), -// updateButtonMessage: NSAttributedString(string: "Update Now, Plz!?"), -// nextTimeButtonMessage: NSAttributedString(string: "OK, next time it is!"), -// skipVersionButtonMessage: NSAttributedString(string: "Please don't push skip, please don't!")) - - // Optional - Defaults to .Option -// siren.alertType = .option // or .force, .skip, .none - - // Optional - Can set differentiated Alerts for Major, Minor, Patch, and Revision Updates (Must be called AFTER siren.alertType, if you are using siren.alertType) - siren.majorUpdateAlertType = .option - siren.minorUpdateAlertType = .option - siren.patchUpdateAlertType = .option - siren.revisionUpdateAlertType = .option - - // Optional - Sets all messages to appear in Russian. Siren supports many other languages, not just English and Russian. -// siren.forceLanguageLocalization = .russian +} - // Optional - Set this variable if your app is not available in the U.S. App Store. List of codes: https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/AppStoreTerritories.html -// siren.countryCode = "" +// Examples on how to use Siren - // Optional - Set this variable if you would only like to show an alert if your app has been available on the store for a few days. - // This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution - // To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution. - siren.showAlertAfterCurrentVersionHasBeenReleasedForDays = 0 +private extension AppDelegate { - // Optional (Only do this if you don't call checkVersion in didBecomeActive) -// siren.checkVersion(checkType: .immediately) + /// The simplest implementation of Siren. + /// All default rules are implemented and the + /// results of the completion handler are ignored. + func defaultExample() { + Siren.shared.wail() } - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - Siren.shared.checkVersion(checkType: .daily) + /// The simplest implementation of Siren. + /// All default rules are implemented and the + /// results of the completion handler are returned or an error is returned. + func defaultExampleUsingCompletionHandler() { + Siren.shared.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - Siren.shared.checkVersion(checkType: .daily) + /// Minor customization to Siren's update alert presentation. + func minimalCustomizationPresentationExample() { + let siren = Siren.shared + siren.presentationManager = PresentationManager(alertTintColor: .purple, + appName: "Siren Example App Override!") + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } -} -extension AppDelegate: SirenDelegate -{ - func sirenDidShowUpdateDialog(alertType: Siren.AlertType) { - print(#function, alertType) + /// Forcing the language of the update alert to a specific localization (e.g., Russian is force in this function. + func forceLocalizationCustomizationPresentationExample() { + let siren = Siren.shared + siren.presentationManager = PresentationManager(forceLanguageLocalization: .russian) + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - - func sirenUserDidCancel() { - print(#function) + + /// Example on how to change specific strings in the update alert. + func customMessagingPresentationExample() { + let siren = Siren.shared + siren.presentationManager = PresentationManager(alertTitle: "Update Now, OK?", + nextTimeButtonTitle: "Next time, please!?") + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - - func sirenUserDidSkipVersion() { - print(#function) + + /// How to present an alert every time the app is foregrounded. + func annoyingRuleExample() { + let siren = Siren.shared + siren.rulesManager = RulesManager(globalRules: .annoying) + + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - - func sirenUserDidLaunchAppStore() { - print(#function) + + /// How to present an alert every time the app is foregrounded. + /// This will block the user from using the app until they update the app. + /// Setting `showAlertAfterCurrentVersionHasBeenReleasedForDays` to `0` IS NOT RECOMMENDED + /// as it will cause the user to go into an endless loop to the App Store if the JSON results + /// update faster than the App Store CDN. + /// + /// The `0` value is illustrated in this app as an example on how to change how quickly an alert is presented. + func hyperCriticalRulesExample() { + let siren = Siren.shared + siren.rulesManager = RulesManager(globalRules: .critical, + showAlertAfterCurrentVersionHasBeenReleasedForDays: 0) + + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - func sirenDidFailVersionCheck(error: Error) { - print(#function, error) + /// Major, Minor, Patch, and Revision specific rules implementations. + func updateSpecificRulesExample() { + let siren = Siren.shared + siren.rulesManager = RulesManager(majorUpdateRules: .annoying, + minorUpdateRules: .default, + patchUpdateRules: .critical, + revisionUpdateRules: Rules(promptFrequency: .weekly, forAlertType: .option)) + + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - func sirenLatestVersionInstalled() { - print(#function, "Latest version of app is installed") + /// An example on how to present your own custom alert using Siren's localized Strings and version checking cadence. + func customAlertRulesExample() { + let siren = Siren.shared + // The key for using custom alerts is to set the `alertType` to `.none`. + // The `Results` type will return localized strings for your app's custom modal presentation. + // The `promptFrequency` allows you to customize how often Siren performs the version check before returning a non-error result back into your app, prompting your custom alert functionality. + let rules = Rules(promptFrequency: .immediately, forAlertType: .none) + siren.rulesManager = RulesManager(globalRules: rules) + + siren.wail { (results, error) in + if let results = results { + print("USE THE VALUES FROM THE `RESULTS` DATA STRUCTURE TO BUILD YOUR UPDATE ALERT WITH LOCALIZED STRINGS.") + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel) { - print(#function, "\(lookupModel)") + /// An example on how to change the App Store region that your app in which your app is available. + // This should only be used if your app is not available in the US App Store. + // This example function illustrates how this can be done by checking against the Russian App Store. + func appStoreCountryChangeExample() { + let siren = Siren.shared + siren.apiManager = APIManager(countryCode: "RU") + + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } - // This delegate method is only hit when alertType is initialized to .none - func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType) { - print(#function, "\n\(title)\n\(message).\nRelease type: \(updateType.rawValue.capitalized)") + /// An example on how to customize multiple managers at once. + func complexExample() { + let siren = Siren.shared + siren.presentationManager = PresentationManager(alertTintColor: .brown, + appName: "Siren's Complex Rule Example App", + alertTitle: "Please, Update Now!", + skipButtonTitle: "Click here to skip!", + forceLanguageLocalization: .spanish) + siren.rulesManager = RulesManager(majorUpdateRules: .annoying, + minorUpdateRules: .default, + patchUpdateRules: .critical, + revisionUpdateRules: .relaxed) + + siren.wail { (results, error) in + if let results = results { + print("AlertAction ", results.alertAction) + print("Localization ", results.localization) + print("LookupModel ", results.lookupModel) + print("UpdateType ", results.updateType) + } else if let error = error { + print(error.localizedDescription) + } + } } } diff --git a/Example/Tests/SirenTests.swift b/Example/Tests/SirenTests.swift index 7c53a42e..652b4980 100644 --- a/Example/Tests/SirenTests.swift +++ b/Example/Tests/SirenTests.swift @@ -9,9 +9,9 @@ import XCTest @testable import Siren -class SirenTests: XCTestCase { +final class SirenTests: XCTestCase { - let siren = Siren.shared + var siren: Siren = Siren.shared } @@ -20,819 +20,776 @@ class SirenTests: XCTestCase { extension SirenTests { func testSingleDigitVersionUpdate() { - siren.testSetCurrentInstalledVersion(version: "1") + siren.currentInstalledVersion = "1" - siren.testSetAppStoreVersion(version: "2") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2")) - siren.testSetAppStoreVersion(version: "2.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0")) - siren.testSetAppStoreVersion(version: "2.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0")) - siren.testSetAppStoreVersion(version: "2.0.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0.0")) - siren.testSetAppStoreVersion(version: "0") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0")) - siren.testSetAppStoreVersion(version: "0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.9")) - siren.testSetAppStoreVersion(version: "0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.9")) - siren.testSetAppStoreVersion(version: "0.0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.0.9")) } func testDoubleDigitVersionUpdate() { - siren.testSetCurrentInstalledVersion(version: "1.0") + siren.currentInstalledVersion = "1.0" - siren.testSetAppStoreVersion(version: "2") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2")) - siren.testSetAppStoreVersion(version: "2.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0")) - siren.testSetAppStoreVersion(version: "2.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0")) - siren.testSetAppStoreVersion(version: "2.0.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0.0")) - siren.testSetAppStoreVersion(version: "0") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0")) - siren.testSetAppStoreVersion(version: "0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.9")) - siren.testSetAppStoreVersion(version: "0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.9")) - siren.testSetAppStoreVersion(version: "0.0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.0.9")) } func testTripleDigitVersionUpdate() { - siren.testSetCurrentInstalledVersion(version: "1.0.0") + siren.currentInstalledVersion = "1.0.0" - siren.testSetAppStoreVersion(version: "2") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2")) - siren.testSetAppStoreVersion(version: "2.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0")) - siren.testSetAppStoreVersion(version: "2.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0")) - siren.testSetAppStoreVersion(version: "2.0.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0.0")) - siren.testSetAppStoreVersion(version: "0") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0")) - siren.testSetAppStoreVersion(version: "0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.9")) - siren.testSetAppStoreVersion(version: "0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.9")) - siren.testSetAppStoreVersion(version: "0.0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.0.9")) } func testQuadrupleDigitVersionUpdate() { - siren.testSetCurrentInstalledVersion(version: "1.0.0") + siren.currentInstalledVersion = "1.0.0" - siren.testSetAppStoreVersion(version: "2") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2")) - siren.testSetAppStoreVersion(version: "2.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0")) - siren.testSetAppStoreVersion(version: "2.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0")) - siren.testSetAppStoreVersion(version: "2.0.0.0") - XCTAssertTrue(siren.isAppStoreVersionNewer()) + XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "2.0.0.0")) - siren.testSetAppStoreVersion(version: "0") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0")) - siren.testSetAppStoreVersion(version: "0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.9")) - siren.testSetAppStoreVersion(version: "0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.9")) - siren.testSetAppStoreVersion(version: "0.0.0.9") - XCTAssertFalse(siren.isAppStoreVersionNewer()) + XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion, + appStoreVersion: "0.0.0.9")) } - } - // MARK: - Localization extension SirenTests { func testArabicLocalization() { - let language: Siren.LanguageType = .arabic - siren.forceLanguageLocalization = language + let language: Localization.Language = .arabic // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "التحديث متوفر") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "التحديث متوفر") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "المرة التالية") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "المرة التالية") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "تخطى عن هذه النسخة") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "تخطى عن هذه النسخة") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "تحديث") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "تحديث") } func testArmenianLocalization() { - let language: Siren.LanguageType = .armenian - siren.forceLanguageLocalization = language + let language: Localization.Language = .armenian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Թարմացումը հասանելի Է") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Թարմացումը հասանելի Է") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Հաջորդ անգամ") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Հաջորդ անգամ") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Բաց թողնել այս տարբերակը") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Բաց թողնել այս տարբերակը") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Թարմացնել") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Թարմացնել") } func testBasqueLocalization() { - let language: Siren.LanguageType = .basque - siren.forceLanguageLocalization = language + let language: Localization.Language = .basque // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Eguneratzea erabilgarri") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Eguneratzea erabilgarri") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Hurrengo batean") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Hurrengo batean") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Bertsio honetatik jauzi egin") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Bertsio honetatik jauzi egin") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Eguneratu") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Eguneratu") } func testChineseSimplifiedLocalization() { - let language: Siren.LanguageType = .chineseSimplified - siren.forceLanguageLocalization = language + let language: Localization.Language = .chineseSimplified // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "更新可用") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "更新可用") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "下一次") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "下一次") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "跳过此版本") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "跳过此版本") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "更新") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "更新") } func testChineseTraditionalLocalization() { - let language: Siren.LanguageType = .chineseTraditional - siren.forceLanguageLocalization = language + let language: Localization.Language = .chineseTraditional // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "有更新可用") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "有更新可用") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "下次") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "下次") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "跳過此版本") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "跳過此版本") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "更新") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "更新") } func testCroatianLocalization() { - let language: Siren.LanguageType = .croatian - siren.forceLanguageLocalization = language + let language: Localization.Language = .croatian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Nova ažuriranje je stigla") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Nova ažuriranje je stigla") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Sljedeći put") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Sljedeći put") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Preskoči ovu verziju") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Preskoči ovu verziju") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Ažuriraj") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ažuriraj") } func testCzechLocalization() { - let language: Siren.LanguageType = .czech - siren.forceLanguageLocalization = language + let language: Localization.Language = .czech // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Aktualizace dostupná") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aktualizace dostupná") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Příště") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Příště") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Přeskočit tuto verzi") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Přeskočit tuto verzi") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Aktualizovat") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Aktualizovat") } func testDanishLocalization() { - let language: Siren.LanguageType = .danish - siren.forceLanguageLocalization = language + let language: Localization.Language = .danish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Tilgængelig opdatering") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Tilgængelig opdatering") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Næste gang") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Næste gang") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Spring denne version over") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Spring denne version over") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Opdater") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Opdater") } func testDutchLocalization() { - let language: Siren.LanguageType = .dutch - siren.forceLanguageLocalization = language + let language: Localization.Language = .dutch // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Update beschikbaar") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Update beschikbaar") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Volgende keer") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Volgende keer") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Sla deze versie over") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Sla deze versie over") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Updaten") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Updaten") } func testEstonianLocalization() { - let language: Siren.LanguageType = .estonian - siren.forceLanguageLocalization = language + let language: Localization.Language = .estonian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Uuendus saadaval") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Uuendus saadaval") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Järgmisel korral") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Järgmisel korral") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Jäta see version vahele") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Jäta see version vahele") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Uuenda") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Uuenda") } func testFinnishLocalization() { - let language: Siren.LanguageType = .finnish - siren.forceLanguageLocalization = language + let language: Localization.Language = .finnish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Päivitys saatavilla") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Päivitys saatavilla") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Ensi kerralla") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Ensi kerralla") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Jätä tämä versio väliin") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Jätä tämä versio väliin") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Päivitys") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Päivitys") } func testFrenchLocalization() { - let language: Siren.LanguageType = .french - siren.forceLanguageLocalization = language + let language: Localization.Language = .french // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Mise à jour disponible") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Mise à jour disponible") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "La prochaine fois") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La prochaine fois") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Sauter cette version") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Sauter cette version") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Mettre à jour") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Mettre à jour") } func testGermanLocalization() { - let language: Siren.LanguageType = .german - siren.forceLanguageLocalization = language + let language: Localization.Language = .german // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Update erhältlich") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Update erhältlich") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Später") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Später") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Diese Version überspringen") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Diese Version überspringen") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Update") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Update") } func testGreekLocalization() { - let language: Siren.LanguageType = .greek - siren.forceLanguageLocalization = language - + let language: Localization.Language = .greek + // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Διαθέσιμη Ενημέρωση") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Διαθέσιμη Ενημέρωση") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Άλλη φορά") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Άλλη φορά") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Αγνόησε αυτήν την έκδοση") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Αγνόησε αυτήν την έκδοση") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Αναβάθμιση") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Αναβάθμιση") } func testHebrewLocalization() { - let language: Siren.LanguageType = .hebrew - siren.forceLanguageLocalization = language + let language: Localization.Language = .hebrew // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "עדכון זמין") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "עדכון זמין") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "בפעם הבאה") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "בפעם הבאה") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "דלג על גרסה זו") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "דלג על גרסה זו") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "עדכן") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "עדכן") } func testHungarianLocalization() { - let language: Siren.LanguageType = .hungarian - siren.forceLanguageLocalization = language + let language: Localization.Language = .hungarian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Új frissítés érhető el") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Új frissítés érhető el") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Később") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Később") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Ennél a verziónál ne figyelmeztessen") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ennél a verziónál ne figyelmeztessen") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Frissítés") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Frissítés") } func testIndonesianLocalization() { - let language: Siren.LanguageType = .indonesian - siren.forceLanguageLocalization = language + let language: Localization.Language = .indonesian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Pembaruan Tersedia") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Pembaruan Tersedia") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Lain kali") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lain kali") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Lewati versi ini") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Lewati versi ini") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Perbarui") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Perbarui") } func testItalianLocalization() { - let language: Siren.LanguageType = .italian - siren.forceLanguageLocalization = language + let language: Localization.Language = .italian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Aggiornamento disponibile") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aggiornamento disponibile") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "La prossima volta") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La prossima volta") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Salta questa versione") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Salta questa versione") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Aggiorna") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Aggiorna") } func testJapaneseLocalization() { - let language: Siren.LanguageType = .japanese - siren.forceLanguageLocalization = language + let language: Localization.Language = .japanese // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "アップデートのお知らせ") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "アップデートのお知らせ") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "次回") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "次回") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "このバージョンをスキップ") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "このバージョンをスキップ") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "アップデート") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "アップデート") } func testKoreanLocalization() { - let language: Siren.LanguageType = .korean - siren.forceLanguageLocalization = language + let language: Localization.Language = .korean // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "업데이트 가능") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "업데이트 가능") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "다음에") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "다음에") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "이 버전 건너뜀") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "이 버전 건너뜀") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "업데이트") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "업데이트") } func testLatvianLocalization() { - let language: Siren.LanguageType = .latvian - siren.forceLanguageLocalization = language + let language: Localization.Language = .latvian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Atjauninājums pieejams") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atjauninājums pieejams") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Nākamreiz") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Nākamreiz") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Izlaist šo versiju") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Izlaist šo versiju") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Atjaunināt") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atjaunināt") } func testLithuanianLocalization() { - let language: Siren.LanguageType = .lithuanian - siren.forceLanguageLocalization = language + let language: Localization.Language = .lithuanian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Atnaujinimas") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atnaujinimas") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Kitą kartą") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Kitą kartą") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Praleisti šią versiją") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Praleisti šią versiją") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Atnaujinti") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atnaujinti") } func testMalayLocalization() { - let language: Siren.LanguageType = .malay - siren.forceLanguageLocalization = language + let language: Localization.Language = .malay // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Versi Terkini") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Versi Terkini") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Lain kali") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lain kali") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Langkau versi ini") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Langkau versi ini") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Muat turun") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Muat turun") } func testNorwegianLocalization() { - let language: Siren.LanguageType = .norwegian - siren.forceLanguageLocalization = language + let language: Localization.Language = .norwegian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Oppdatering tilgjengelig") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Oppdatering tilgjengelig") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Neste gang") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Neste gang") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Hopp over denne versjonen") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Hopp over denne versjonen") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Oppdater") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Oppdater") } func testPersianLocalization() { - let language: Siren.LanguageType = .persian - siren.forceLanguageLocalization = language - + let language: Localization.Language = .persian + // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "دفعه بعد") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دفعه بعد") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "بروزرسانی") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی") } func testPersianAfghanistanLocalization() { - let language: Siren.LanguageType = .persianAfghanistan - siren.forceLanguageLocalization = language + let language: Localization.Language = .persianAfghanistan // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "دگر بار") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دگر بار") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "بروزرسانی") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی") } func testPersianIranLocalization() { - let language: Siren.LanguageType = .persianIran - siren.forceLanguageLocalization = language - + let language: Localization.Language = .persianIran + // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "دفعه بعد") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دفعه بعد") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "بروزرسانی") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی") } func testPolishLocalization() { - let language: Siren.LanguageType = .polish - siren.forceLanguageLocalization = language + let language: Localization.Language = .polish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Aktualizacja dostępna") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aktualizacja dostępna") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Następnym razem") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Następnym razem") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Pomiń wersję") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Pomiń wersję") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Zaktualizuj") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Zaktualizuj") } func testPortugueseBrazilLocalization() { - let language: Siren.LanguageType = .portugueseBrazil - siren.forceLanguageLocalization = language + let language: Localization.Language = .portugueseBrazil // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Atualização disponível") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atualização disponível") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Próxima vez") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Próxima vez") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Ignorar esta versão") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ignorar esta versão") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Atualizar") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atualizar") } func testPortuguesePortugalLocalization() { - let language: Siren.LanguageType = .portuguesePortugal - siren.forceLanguageLocalization = language + let language: Localization.Language = .portuguesePortugal // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Nova actualização disponível") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Nova actualização disponível") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Próxima vez") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Próxima vez") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Ignorar esta versão") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ignorar esta versão") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Actualizar") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Actualizar") } func testRussianLocalization() { - let language: Siren.LanguageType = .russian - siren.forceLanguageLocalization = language + let language: Localization.Language = .russian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Доступно обновление") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Доступно обновление") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "В следующий раз") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "В следующий раз") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Пропустить эту версию") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Пропустить эту версию") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Обновить") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Обновить") } func testSerbianCyrillicLocalization() { - let language: Siren.LanguageType = .serbianCyrillic - siren.forceLanguageLocalization = language + let language: Localization.Language = .serbianCyrillic // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Ажурирање доступно") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Ажурирање доступно") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Следећи пут") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Следећи пут") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Прескочи ову верзију") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Прескочи ову верзију") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Ажурирај") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ажурирај") } func testSerbianLatinLocalization() { - let language: Siren.LanguageType = .serbianLatin - siren.forceLanguageLocalization = language + let language: Localization.Language = .serbianLatin // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Ažuriranje dostupno") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Ažuriranje dostupno") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Sledeći put") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Sledeći put") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Preskoči ovu verziju") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Preskoči ovu verziju") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Ažuriraj") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ažuriraj") } func testSlovenianLocalization() { - let language: Siren.LanguageType = .slovenian - siren.forceLanguageLocalization = language + let language: Localization.Language = .slovenian // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Posodobitev aplikacije") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Posodobitev aplikacije") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Naslednjič") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Naslednjič") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Ne želim") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ne želim") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Namesti") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Namesti") } func testSpanishLocalization() { - let language: Siren.LanguageType = .spanish - siren.forceLanguageLocalization = language + let language: Localization.Language = .spanish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Actualización disponible") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Actualización disponible") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "La próxima vez") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La próxima vez") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Saltar esta versión") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Saltar esta versión") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Actualizar") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Actualizar") } func testSwedishLocalization() { - let language: Siren.LanguageType = .swedish - siren.forceLanguageLocalization = language + let language: Localization.Language = .swedish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Tillgänglig uppdatering") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Tillgänglig uppdatering") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Nästa gång") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Nästa gång") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Hoppa över den här versionen") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Hoppa över den här versionen") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Uppdatera") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Uppdatera") } func testThaiLocalization() { - let language: Siren.LanguageType = .thai - siren.forceLanguageLocalization = language + let language: Localization.Language = .thai // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "มีการอัพเดท") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "มีการอัพเดท") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "ไว้คราวหน้า") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "ไว้คราวหน้า") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "ข้ามเวอร์ชั่นนี้") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "ข้ามเวอร์ชั่นนี้") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "อัพเดท") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "อัพเดท") } func testTurkishLocalization() { - let language: Siren.LanguageType = .turkish - siren.forceLanguageLocalization = language + let language: Localization.Language = .turkish // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Güncelleme Mevcut") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Güncelleme Mevcut") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Daha sonra") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Daha sonra") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Boşver") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Boşver") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Güncelle") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Güncelle") } func testUkrainianLocalization() { - let language: Siren.LanguageType = .ukrainian - siren.forceLanguageLocalization = language - + let language: Localization.Language = .ukrainian + // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Доступне Оновлення") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Доступне Оновлення") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Наступного разу") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Наступного разу") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Пропустити версію") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Пропустити версію") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Оновити") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Оновити") } func testUrduLocalization() { - let language: Siren.LanguageType = .urdu - siren.forceLanguageLocalization = language + let language: Localization.Language = .urdu // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "نیا اپڈیٹ") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "نیا اپڈیٹ") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "اگلی مرتبہ") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "اگلی مرتبہ") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "اس ورزن کو چھوڑ دیں") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "اس ورزن کو چھوڑ دیں") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "اپڈیٹ کریں") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "اپڈیٹ کریں") } func testVietnameseLocalization() { - let language: Siren.LanguageType = .vietnamese - siren.forceLanguageLocalization = language + let language: Localization.Language = .vietnamese // Update Available - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update Available", forceLanguageLocalization: language), "Cập nhật mới") + XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Cập nhật mới") // Next time - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Next time", forceLanguageLocalization: language), "Lần tới") + XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lần tới") // Skip this version - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Skip this version", forceLanguageLocalization: language), "Bỏ qua phiên bản này") + XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Bỏ qua phiên bản này") // Update - XCTAssertEqual(Bundle().testLocalizedString(forKey: "Update", forceLanguageLocalization: language), "Cập nhật") + XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Cập nhật") } } diff --git a/Gemfile b/Gemfile index d62d861b..0d8c69d2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ -# A sample Gemfile source "https://rubygems.org" gem "cocoapods" diff --git a/README.md b/README.md index 44995f03..6e405fd4 100755 --- a/README.md +++ b/README.md @@ -11,9 +11,7 @@ - [Features](https://github.com/ArtSabintsev/Siren#features) - [Screenshots](https://github.com/ArtSabintsev/Siren#screenshots) - [Installation Instructions](https://github.com/ArtSabintsev/Siren#installation-instructions) -- [Example Code](https://github.com/ArtSabintsev/Siren#example-code) -- [Granular/Differentiated Version Management](https://github.com/ArtSabintsev/Siren#granular-version-update-management) -- [Delegates (Optional)](https://github.com/ArtSabintsev/Siren#optional-delegate-and-delegate-methods) +- [Implementation Examples](https://github.com/ArtSabintsev/Siren#example-code) - [Localization](https://github.com/ArtSabintsev/Siren#localization) - [Device Compatibility](https://github.com/ArtSabintsev/Siren#device-compatibility) - [Testing Siren](https://github.com/ArtSabintsev/Siren#testing-siren) @@ -21,6 +19,7 @@ - [Phased Releases](https://github.com/ArtSabintsev/Siren#phased-releases) - [Words of Caution](https://github.com/ArtSabintsev/Siren#words-of-caution) - [Ports](https://github.com/ArtSabintsev/Siren#ports) +- [Shout-Out and Gratitude](https://github.com/ArtSabintsev/Siren#shout-out-and-gratitude) - [Attribution](https://github.com/ArtSabintsev/Siren#created-and-maintained-by) --- @@ -31,29 +30,30 @@ If a new version is available, an alert can be presented to the user informing them of the newer version, and giving them the option to update the application. Alternatively, Siren can notify your app programmatically, enabling you to inform the user through alternative means, such as a custom interface. - Siren is built to work with the [**Semantic Versioning**](https://semver.org/) system. - - Semantic Versioning is a three number versioning system (e.g., 1.0.0) + - Canonical Semantic Versioning uses a three number versioning system (e.g., 1.0.0) - Siren also supports two-number versioning (e.g., 1.0) and four-number versioning (e.g., 1.0.0.0) -- Siren is actively maintained by [**Arthur Sabintsev**](https://github.com/ArtSabintsev) and [**Aaron Brager**](https://twitter.com/getaaron) - -### README Translations -- [**简体中文**](README.zh_CN.md) (by [**Daniel Hu**](https://www.jianshu.com/u/d8bbc4831623)) ## Features -- [x] CocoaPods Support -- [x] Carthage Support -- [x] Swift Package Manager Support -- [x] Localized for 30+ languages (see [Localization](https://github.com/ArtSabintsev/Siren#localization)) -- [x] Pre-Update Device Compatibility Check (see [Device Compatibility](https://github.com/ArtSabintsev/Siren#device-compatibility)) -- [x] Three types of alerts (see [Screenshots](https://github.com/ArtSabintsev/Siren#screenshots)) -- [x] Optional delegate methods (see [Delegates (Optional)](https://github.com/ArtSabintsev/Siren#optional-delegate-and-delegate-methods)) -- [x] Unit Tests -- [x] Documentation can be found at http://sabintsev.com/Siren. + +### Current Features +- [x] CocoaPods, Carthage, and Swift Package Manager Support +- [x] Three Types of Alerts (see [Screenshots](https://github.com/ArtSabintsev/Siren#screenshots)) +- [x] Highly Customizable Presentation Rules [Implementation Examples](https://github.com/ArtSabintsev/Siren#implementation-examples)) +- [x] Localized for 40+ Languages (see [Localization](https://github.com/ArtSabintsev/Siren#localization)) +- [x] Device Compatibility Check (see [Device Compatibility](https://github.com/ArtSabintsev/Siren#device-compatibility)) +- [x] 100% Documentation Coverage + +### Future Features +- [ ] Present prompt only on WiFi if app is over the OTA limit. +- [ ] Support for Third-/Homegrown Update Servers (not including TestFlight). +- [ ] Increase code coverage with more unit tests and UI tests. + ## Screenshots - The **left picture** forces the user to update the app. - The **center picture** gives the user the option to update the app. - The **right picture** gives the user the option to skip the current update. -- These options are controlled by the `Siren.AlertType` enum. +- These options are controlled by the `Rules.AlertType` enum. @@ -88,199 +88,56 @@ github "ArtSabintsev/Siren" "swift2.3" // Swift 2.3 ### Swift Package Manager ```swift -.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 3) +.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 4) ``` -## Example Code - -Below is some commented sample code. Adapt this to meet your app's needs. - -For a full list of optional settings/preferences, please refer to https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift in the Sample Project. - -```Swift -func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - /* Siren code should go below window?.makeKeyAndVisible() */ - - // Siren is a singleton - let siren = Siren.shared - - // Optional: Defaults to .option - siren.alertType = <#Siren.AlertType_Enum_Value#> - - // Optional: Change the various UIAlertController and UIAlertAction messaging. One or more values can be changes. If only a subset of values are changed, the defaults with which Siren comes with will be used. - siren.alertMessaging = SirenAlertMessaging(updateTitle: NSAttributedString(string: "New Fancy Title"), - updateMessage: NSAttributedString(string: "New message goes here!"), - updateButtonMessage: NSAttributedString(string: "Update Now, Plz!?"), - nextTimeButtonMessage: NSAttributedString(string: "OK, next time it is!"), - skipVersionButtonMessage: NSAttributedString(string: "Please don't push skip, please don't!")) - +## Implementation Examples +Implementing Siren is as easy as adding two line of code to your app. - // Optional: Set this variable if you would only like to show an alert if your app has been available on the store for a few days. - // This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution - // To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution. - siren.showAlertAfterCurrentVersionHasBeenReleasedForDays = 3 - - // Replace .immediately with .daily or .weekly to specify a maximum daily or weekly frequency for version checks. - // DO NOT CALL THIS METHOD IN didFinishLaunchingWithOptions IF YOU ALSO PLAN TO CALL IT IN applicationDidBecomeActive. - siren.checkVersion(checkType: .immediately) - - return true -} - -func applicationDidBecomeActive(application: UIApplication) { - /* - Perform daily (.daily) or weekly (.weekly) checks for new version of your app. - Useful if user returns to your app from the background after extended period of time. - Place in applicationDidBecomeActive(_:). - */ +```swift +import Siren // Line 1 +import UIKit - Siren.shared.checkVersion(checkType: .daily) -} +@UIApplicationMain +final class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? -func applicationWillEnterForeground(application: UIApplication) { - /* - Useful if user returns to your app from the background after being sent to the - App Store, but doesn't update their app before coming back to your app. + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + window?.makeKeyAndVisible() - ONLY USE WITH Siren.AlertType.immediately - */ + Siren.shared.wail() // Line 2 - Siren.shared.checkVersion(checkType: .immediately) + return true + } } ``` -And you're all set! - -### Prompting for Updates without Alerts - -Some developers may want to display a less obtrusive custom interface, like a banner or small icon. To accomplish this, you can disable alert presentation by doing the following: +Siren also has plenty of customization options. All examples can be found in the Example Project's [**AppDelegate**](https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift) file. Uncomment the example you'd like to test. + -```swift -func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - ... - siren.delegate = self - siren.alertType = .none - ... -} +**WARNING**: Siren should ONLY be placed in [UIApplication.didFinishLaunchingWithOptions](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application) and only after the `window?.makeKeyAndVisible()` call. Siren initializes a listener on [didBecomeActiveNotification](https://developer.apple.com/reference/foundation/nsnotification.name/1622953-uiapplicationdidbecomeactive) to perform version checks. -extension AppDelegate: SirenDelegate { - // Returns a localized message to this delegate method upon performing a successful version check - func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType) { - print("\(message)") - } -} -``` +## Localization +Siren is localized for the following languages: -Siren will call the `sirenDidDetectNewVersionWithoutAlert(message: String)` delegate method, passing a localized, suggested update string suitable for display. Implement this method to display your own messaging, optionally using `message`. +Arabic, Armenian, Basque, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian (Bokmål), Persian (Afghanistan, Iran, Persian), Polish, Portuguese (Brazil and Portugal), Russian, Serbian (Cyrillic and Latin), Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Urdu, Vietnamese -## Granular Version Update Management -If you would like to set a different type of alert for revision, patch, minor, and/or major updates, simply add one or all of the following *optional* lines to your setup *before* calling the `checkVersion()` method: +You may want the update dialog to *always* appear in a certain language, ignoring the user's device-specific setting. You can enable it like so: ```swift -/* Siren defaults to Siren.AlertType.option for all updates */ -siren.shared.revisionUpdateAlertType = <#Siren.AlertType_Enum_Value#> -siren.shared.patchUpdateAlertType = <#Siren.AlertType_Enum_Value#> -siren.shared.minorUpdateAlertType = <#Siren.AlertType_Enum_Value#> -siren.shared.majorUpdateAlertType = <#Siren.AlertType_Enum_Value#> +// In this example, we force the `russian` language. +Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian) ``` -## Optional Delegate and Delegate Methods -Six delegate methods allow you to handle or track the user's behavior. Each method has a default, empty implementation, effectively making each of these methods optional. - -``` swift -public protocol SirenDelegate: NSObjectProtocol { - /// Siren performed version check and did not display alert. - func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType) - - /// Siren failed to perform version check. - /// - /// - Note: - /// Depending on the reason for failure, - /// a system-level error may be returned. - func sirenDidFailVersionCheck(error: Error) - - /// User presented with update dialog. - func sirenDidShowUpdateDialog(alertType: Siren.AlertType) - - /// Siren performed a version check and latest version is installed. - func sirenLatestVersionInstalled() - - /// Provides the decoded JSON information from a successful version check call. - /// - /// - SeeAlso: - /// SirenLookupModel.swift - /// - /// - Parameter lookupModel: The `Decodable` model representing the JSON results from the iTunes Lookup API. - func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel) - - /// User did click on button that cancels update dialog. - func sirenUserDidCancel() - - /// User did click on button that launched "App Store.app". - func sirenUserDidLaunchAppStore() - - /// User did click on button that skips version update. - func sirenUserDidSkipVersion() -} -``` - -## Localization -Siren is localized for -- Arabic -- Armenian -- Basque -- Chinese (Simplified and Traditional) -- Croatian -- Czech -- Danish -- Dutch -- English -- Estonian -- Finnish -- French -- German -- Greek -- Hebrew -- Hungarian -- Indonesian -- Italian -- Japanese -- Korean -- Latvian -- Lithuanian -- Malay -- Norwegian (Bokmål) -- Persian (Afghanistan, Iran, Persian) -- Polish -- Portuguese (Brazil and Portugal) -- Russian -- Serbian (Cyrillic and Latin) -- Slovenian -- Spanish -- Swedish -- Thai -- Turkish -- Ukrainian -- Urdu -- Vietnamese - -You may want the update dialog to *always* appear in a certain language, ignoring iOS's language setting (e.g. apps released in a specific country). - -You can enable it like so: - -```swift -Siren.shared.forceLanguageLocalization = Siren.LanguageType.<#Siren.LanguageType_Enum_Value#> -``` ## Device Compatibility -If an app update is available, Siren checks to make sure that the version of iOS on the user's device is compatible with the one that is required by the app update. For example, if a user has iOS 10 installed on their device, but the app update requires iOS 11, an alert will not be shown. This takes care of the *false positive* case regarding app updating. +If an app update is available, Siren checks to make sure that the version of iOS on the user's device is compatible with the one that is required by the app update. For example, if a user has iOS 11 installed on their device, but the app update requires iOS 12, an alert will not be shown. This takes care of the *false positive* case regarding app updating. ## Testing Siren -Temporarily change the version string in Xcode (within the `.xcodeproj`) to an older version than the one that's currently available in the App Store. Afterwards, build and run your app, and you should see the alert. +Temporarily change the version string in Xcode (within the `.xcodeproj` file) to an older version than the one that's currently available in the App Store. Afterwards, build and run your app, and you should see the alert. If you currently don't have an app in the store, change your bundleID to one that is already in the store. In the sample app packaged with this library, we use the [App Store Connect](https://itunes.apple.com/app/id1234793120) app's bundleID: `com.apple.AppStoreConnect`. -For your convenience, you may turn on debugging statements by setting `self.debugEnabled = true` before calling the `checkVersion()` method. - ## App Store Submissions The App Store reviewer will **not** see the alert. The version in the App Store will always be older than the version being reviewed. @@ -288,7 +145,7 @@ The App Store reviewer will **not** see the alert. The version in the App Store In 2017, Apple announced the [ability to rollout app updates gradually (a.k.a. Phased Releases)](https://itunespartner.apple.com/en/apps/faq/Managing%20Your%20Apps_Submission%20Process). Siren will continue to work as it has in the past, presenting an update modal to _all_ users. If you opt-in to a phased rollout for a specific version, you have a few choices: - You can leave Siren configured as normal. Phased rollout will continue to auto-update apps. Since all users can still manually update your app directly from the App Store, Siren will ignore the phased rollout and will prompt users to update. -- You can set `showAlertAfterCurrentVersionHasBeenReleasedForDays` to `7`, and Siren will not prompt any users until the latest version is 7 days old, after phased rollout is complete. +- You can set `showAlertAfterCurrentVersionHasBeenReleasedForDays` to `7`, and Siren will not prompt any users until the latest version is 7 days old, after the phased rollout is complete. - You can remotely disable Siren until the rollout is done using your own API / backend logic. ## Words of Caution @@ -298,6 +155,7 @@ Occasionally, the iTunes JSON will update faster than the App Store CDN, meaning - **Objective-C (iOS)** - [**Harpy**](https://github.com/ArtSabintsev/Harpy) - Siren was ported _from_ Harpy, as Siren and Harpy are maintained by the same developer. + - As of December 2018, Harpy has been deprecated in favor of Siren. - **Java (Android)** - [**Egghead Games' Siren library**](https://github.com/eggheadgames/Siren) - The Siren Swift library inspired the Java library. @@ -305,5 +163,12 @@ Occasionally, the iTunes JSON will update faster than the App Store CDN, meaning - [**Gant Laborde's Siren library**](https://github.com/GantMan/react-native-siren) - The Siren Swift library inspired the React Native library. +## Shout-Out and Gratitude +A massive shout-out and thank you goes to the following folks: + +- [Aaron Brager](https://twitter.com/@getaaron) for motivating me and assisting me in building the initial proof-of-concept of Siren (based on [Harpy](https:github.com/ArtSabintsev/Harpy)) back in 2015. Without him, Siren may never have been built. +- All of [Harpy's Consitrbutors](https://github.com/ArtSabintsev/Harpy/graphs/contributors) for helping building the feature set from 2012-2015 that was used as the basis for the first version of Siren. +- All of [Siren's Contributors](https://github.com/ArtSabintsev/Siren/graphs/contributors) for helping make Siren as powerful and bug-free as it currently is today. + ## Created and maintained by -[Arthur Ariel Sabintsev](http://www.sabintsev.com/) & [Aaron Brager](https://twitter.com/getaaron) +[Arthur Ariel Sabintsev](http://www.sabintsev.com/) diff --git a/README.zh_CN.md b/README.zh_CN.md deleted file mode 100644 index d43e71b2..00000000 --- a/README.zh_CN.md +++ /dev/null @@ -1,232 +0,0 @@ -# Siren [English](README.md) - -### 当您的 app 有新版本可用时提示用户进行更新。 - -[![Travis-CI](https://travis-ci.org/ArtSabintsev/Siren.svg?branch=master)](https://travis-ci.org/ArtSabintsev/Siren) [![CocoaPods](https://img.shields.io/cocoapods/v/Siren.svg)](https://cocoapods.org/pods/Siren) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![SwiftPM Compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/) [![CocoaPods](https://img.shields.io/cocoapods/dt/Siren.svg)](https://cocoapods.org/pods/Siren) [![CocoaPods](https://img.shields.io/cocoapods/dm/Siren.svg)](https://cocoapods.org/pods/Siren) ---- - -## 关于 -**Siren** 用于检测用户当前安装版本是否是 App Store 上的最新可用版本。 - -当 app 有更新时,Siren 会弹出提示框,用户可根据提示框提供的选项进行更新。或者您也可以根据 Siren 发出的消息来自定义通知用户的方式,比如您可以提供一个自定义的提示框。 - -- Siren 可配合 [**Semantic Versioning**](https://semver.org/) 系统使用 - - Semantic 版本系统由三位数字标识 (比如,1.0.0) - - Siren 同时支持两位数字标识 (比如,1.0) - - Siren 同时支持四位数字标识 (比如,1.0.0.0) -- Siren 当前处于活跃维护状态,由[**Arthur Sabintsev**](https://github.com/ArtSabintsev) 和 [**Aaron Brager**](https://twitter.com/getaaron) 进行维护。 - - -## Ports -- [**Harpy**](https://github.com/ArtSabintsev/Harpy) 是 Objective-C 实现的版本更新检查库,Siren 是 Harpy 的 swift 版本。 -- Siren 和 Harpy 是由相同的开发者维护。 -- 安卓平台 Play Store 上的 [**Egghead Games' Siren library**](https://github.com/eggheadgames/Siren) 库使用了和 Siren 相同的原理实现了版本更新检测。 -- 针对 React Native 项目 (iOS/Android) 的 [**Gant Laborde's Siren library**](https://github.com/GantMan/react-native-siren) 库使用了和 Siren 相同的原理实现了版本更新检测。 - -## 特点 -- [x] 支持 Cocoapods -- [x] 支持 Carthage -- [x] 支持 Swift 包管理器 -- [x] 30+ 语言本地化 (查看**本地化**) -- [x] 设备兼容性检测 (查看**设备兼容性**) -- [x] 三种类型的弹出提示框 (查看**截图**) -- [x] 可选代理方法 (查看**可选代理**) -- [x] 单元测试! - -## 截图 - -- **左图** 强制用户更新 -- **中间** 给用户提供更新选项 -- **右图** 给用户提供更新和跳过更新选项 -- 这些选项对应着 `SirenAlertType` 枚举类型 - - - - - -## 安装指南 - -### CocoaPods -Swift 3 版本: -```ruby -pod 'Siren' -``` - -Swift 2.3 版本: - -```ruby -pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift2.3' -``` - -Swift 2.2 版本: - -```ruby -pod 'Siren', '0.9.5' -``` - -### Carthage -FSwift 3 版本: - -``` swift -github "ArtSabintsev/Siren" -``` - -Swift 2.3 版本: - -``` swift -github "ArtSabintsev/Siren" "swift2.3" -``` - -### Swift 包管理器 -```swift -.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 1) -``` - -## 使用 -下面是一些示例代码。请根据您的需求进行修改。更详细的使用说明请参考示例项目中的 https://github.com/ArtSabintsev/Siren/blob/master/Sample%20App/Sample%20App/AppDelegate.swift。 - -```Swift -func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - /* Siren code should go below window?.makeKeyAndVisible() */ - - // Siren is a singleton - let siren = Siren.sharedInstance - - // Optional: Defaults to .Option - siren.alertType = <#SirenAlertType_Enum_Value#> - - /* - Replace .Immediately with .Daily or .Weekly to specify a maximum daily or weekly frequency for version - checks. - */ - siren.checkVersion(checkType: .immediately) - - return true -} - -func applicationDidBecomeActive(application: UIApplication) { - /* - Perform daily (.Daily) or weekly (.Weekly) checks for new version of your app. - Useful if user returns to your app from the background after extended period of time. - Place in applicationDidBecomeActive(_:). */ - - Siren.sharedInstance.checkVersion(checkType: .daily) -} - -func applicationWillEnterForeground(application: UIApplication) { - /* - Useful if user returns to your app from the background after being sent to the - App Store, but doesn't update their app before coming back to your app. - - ONLY USE WITH SirenAlertType.Force - */ - - Siren.sharedInstance.checkVersion(checkType: .immediately) -} -``` - -### 使用非弹出提示框进行提示 - -您可以使用顶部条幅等更友好的方式进行提示。首先,您需要通过下面代码禁用弹出提示框: - -```swift -func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - ... - siren.delegate = self - siren.alertType = .None - ... -} - -extension AppDelegate: SirenDelegate { - // 当检测到有更新可用时向该代理方法传递一个本地化的提示信息 - func sirenDidDetectNewVersionWithoutAlert(message: String) { - print("\(message)") - } -} -``` -Siren 会调用 `sirenDidDetectNewVersionWithoutAlert(message: String)` 代理方法,该方法传递了一个本地化的更新提示信息作为参数。您可以使用该参数作为提示信息,也可以使用自定义的提示信息。 - -## 为修订版,补丁,小版本,大版本设置不同的提示框类型 -您可以为修订版,补丁,小版本,大版本等设置不同提示框类型,只需要在 `checkVersion()` 方法前调用进行如下设置即可: - -```swift - /* Siren defaults to SirenAlertType.Option for all updates */ - siren.sharedInstance().revisionUpdateAlertType = <#SirenAlertType_Enum_Value#> - siren.sharedInstance().patchUpdateAlertType = <#SirenAlertType_Enum_Value#> - siren.sharedInstance().minorUpdateAlertType = <#SirenAlertType_Enum_Value#> - siren.sharedInstance().majorUpdateAlertType = <#SirenAlertType_Enum_Value#> -``` - -##可选代理和代理方法 -您可以通过下面六个代理方法跟踪用户进行的操作。 - -``` swift -public protocol SirenDelegate: class { - func sirenDidShowUpdateDialog(alertType: SirenAlertType) // 弹出更新提示框 - func sirenUserDidLaunchAppStore() // 用户点击去 app store 更新 - func sirenUserDidSkipVersion() // 用户点击跳过此次更新 - func sirenUserDidCancel() // 用户点击取消更新 - func sirenDidFailVersionCheck(error: NSError) // 检查更新失败(可能返回系统级别的错误) - func sirenDidDetectNewVersionWithoutAlert(message: String) // 检测到更新但不弹出提示框 -} -``` - -## 本地化 -Siren 为以下国家做了本地化 -- Arabic -- Armenian -- Basque -- Chinese (Simplified and Traditional) -- Danish -- Dutch -- English -- Estonian -- Finnish -- French -- German -- Greek -- Hebrew -- Hungarian -- Indonesian -- Italian -- Japanese -- Korean -- Latvian -- Lithuanian -- Malay -- Norwegian (Bokmål) -- Polish -- Portuguese (Brazil and Portugal) -- Russian -- Serbian (Cyrillic and Latin) -- Slovenian -- Swedish -- Spanish -- Thai -- Turkish -- Vietnamese - -您可以通过以下代码忽略 iOS 系统语言设置,为弹出框设置固定语言。 - -```swift -Siren.sharedInstance.forceLanguageLocalization = SirenLanguageType.<#SirenLanguageType_Enum_Value#> -``` - -## 设备兼容性 -当有更新可用时,Siren 会检测用户的 iOS 版本号是否符合更新需求。比如,用户的系统是 iOS 9,但此次更新只针对 iOS 10,这时是不会出现弹出提示框。 - -## 测试 -测试时,需要暂时将 Xcode 里(`.xcodeproj` 文件) 的版本号修改为比当前苹果商店中的可用版本号大。这样编译运行 app 时,您就可以看到弹出提示框。 - -如果您尚未发布过 App,把 bundleID 修改为一个 app store 已经存在的 bundleID。在示例项目中,我们使用了 [iTunes Connect Mobile](https://itunes.apple.com/us/app/itunes-connect/id376771144?mt=8) 的 bundleID:`com.apple.itunesconnect.mobile`。 - -为方便调试,您可以在调用 `checkVersion()` 方法前通过 `self.debugEnabled = true` 来开启调试模式。 - -## 提交至 App Store -因为商店里的可用版本总是比提交审核的版本老,所以苹果商店审核人员在审核时是**不会**弹出提示框的。 - -##创建维护人员 -[Arthur Ariel Sabintsev](http://www.sabintsev.com/) & [Aaron Brager](https://twitter.com/getaaron) - -## 翻译人员 -[Daniel Hu](https://www.jianshu.com/u/d8bbc4831623) \ No newline at end of file diff --git a/Siren.podspec b/Siren.podspec index 9708fa73..f9c7322f 100755 --- a/Siren.podspec +++ b/Siren.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| # Version - s.version = "3.9.2" + s.version = "4.0.0" s.swift_version = '4.2' # Meta @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.summary = "Notify users that a new version of your iOS app is available, and prompt them with the App Store link." s.homepage = "https://github.com/ArtSabintsev/Siren" s.license = "MIT" - s.authors = { "Arthur Ariel Sabintsev" => "arthur@sabintsev.com", "Aaron Brager" => "getaaron@gmail.com" } + s.authors = { "Arthur Ariel Sabintsev" => "arthur@sabintsev.com" } s.description = <<-DESC Notify your users when a new version of your iOS app is available, and prompt them with the App Store link. DESC diff --git a/Sources/Extensions/BundleExtension.swift b/Sources/Extensions/BundleExtension.swift new file mode 100644 index 00000000..84c09e78 --- /dev/null +++ b/Sources/Extensions/BundleExtension.swift @@ -0,0 +1,111 @@ +// +// BundleExtension.swift +// Siren +// +// Created by Arthur Sabintsev on 3/17/17. +// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +// `Bundle` Extension for Siren. +extension Bundle { + /// Constants used in the `Bundle` extension. + struct Constants { + /// Constant for the `.bundle` file extension. + static let bundleExtension = "bundle" + /// Constant for `CFBundleDisplayName`. + static let displayName = "CFBundleDisplayName" + /// Constant for the default US English localization. + static let englishLocalization = "en" + /// Constant for the project file extension. + static let projectExtension = "lproj" + /// Constant for `CFBundleShortVersionString`. + static let shortVersionString = "CFBundleShortVersionString" + /// Constant for the localization table. + static let table = "SirenLocalizable" + } + + /// Fetches the current verison of the app. + /// + /// - Returns: The current installed version of the app. + final class func version() -> String? { + return Bundle.main.object(forInfoDictionaryKey: Constants.shortVersionString) as? String + } + + /// Returns the localized string for a given default string. + /// + /// By default, the English language localization is used. + /// If the device's localization is set to another locale, that local's language is used if it's supported by Siren. + /// If `forcedLanguage` is set to `true`, the chosen language is shown for all devices, irrespective of their device's localization. + /// + /// + /// - Parameters: + /// - key: The default string used to search the localization table for a specific translation. + /// - forcedLanguage: Returns + /// - Returns: The localized string for a given key. + final class func localizedString(forKey key: String, andForceLocalization forcedLanguage: Localization.Language?) -> String { + guard var path = sirenBundlePath() else { + return key + } + + if let deviceLangauge = deviceLanguage(), + let devicePath = sirenForcedBundlePath(forceLanguageLocalization: deviceLangauge) { + path = devicePath + } + + if let forcedLanguage = forcedLanguage, + let forcedPath = sirenForcedBundlePath(forceLanguageLocalization: forcedLanguage) { + path = forcedPath + } + + return Bundle(path: path)?.localizedString(forKey: key, value: key, table: Constants.table) ?? key + } + + /// The appropriate name for the app to be displayed in the update alert. + /// + /// Siren checks `CFBundleDisplayName` first. It then falls back to + /// to `kCFBundleNameKey` and ultimately to an empty string + /// if the aforementioned values are nil. + /// + /// - Returns: The name of the app. + final class func bestMatchingAppName() -> String { + let bundleDisplayName = Bundle.main.object(forInfoDictionaryKey: Constants.displayName) as? String + let bundleName = Bundle.main.object(forInfoDictionaryKey: kCFBundleNameKey as String) as? String + + return bundleDisplayName ?? bundleName ?? "" + } +} + +private extension Bundle { + /// The path to Siren's localization `Bundle`. + /// + /// - Returns: The bundle's path or `nil`. + final class func sirenBundlePath() -> String? { + return Bundle(for: Siren.self).path(forResource: "\(Siren.self)", ofType: Constants.bundleExtension) + } + + /// The path for a particular language localizationin Siren's localization `Bundle`. + /// + /// - Parameter forceLanguageLocalization: The language localization that should be searched for in Siren's localization `bundle`. + /// - Returns: The path to the forced language localization. + final class func sirenForcedBundlePath(forceLanguageLocalization: Localization.Language) -> String? { + guard let path = sirenBundlePath() else { return nil } + let name = forceLanguageLocalization.rawValue + + return Bundle(path: path)?.path(forResource: name, ofType: Constants.projectExtension) + } + + /// The user's preferred language based on their device's localization. + /// + /// - Returns: The user's preferred language. + final class func deviceLanguage() -> Localization.Language? { + guard let preferredLocalization = Bundle.main.preferredLocalizations.first, + preferredLocalization != Constants.englishLocalization, + let preferredLanguage = Localization.Language(rawValue: preferredLocalization) else { + return nil + } + + return preferredLanguage + } +} diff --git a/Sources/Extensions/SirenDateExtension.swift b/Sources/Extensions/DateExtension.swift similarity index 62% rename from Sources/Extensions/SirenDateExtension.swift rename to Sources/Extensions/DateExtension.swift index a4f2d529..105feaae 100644 --- a/Sources/Extensions/SirenDateExtension.swift +++ b/Sources/Extensions/DateExtension.swift @@ -1,6 +1,6 @@ // -// SirenDateExtension.swift -// SirenExample +// DateExtension.swift +// Siren // // Created by Arthur Sabintsev on 3/21/17. // Copyright © 2017 Sabintsev iOS Projects. All rights reserved. @@ -8,15 +8,22 @@ import Foundation -// MARK: - Date Extension for Siren - +// `Date` Extension for Siren. extension Date { + /// The amount of days passed from a specific source date. + /// + /// - Parameter date: The source date. + /// - Returns: The amount of days passed since the source date. static func days(since date: Date) -> Int { let calendar = Calendar.current let components = calendar.dateComponents([.day], from: date, to: Date()) return components.day ?? 0 } + /// The amount of days passed from a specific source date string. + /// + /// - Parameter dateString: The source date string. + /// - Returns: The amount of days passed since the source date. static func days(since dateString: String) -> Int? { let dateformatter = DateFormatter() dateformatter.locale = Locale(identifier: "en_US_POSIX") diff --git a/Sources/Extensions/SirenBundleExtension.swift b/Sources/Extensions/SirenBundleExtension.swift deleted file mode 100644 index 79adbe74..00000000 --- a/Sources/Extensions/SirenBundleExtension.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// SirenBundleExtension.swift -// SirenExample -// -// Created by Arthur Sabintsev on 3/17/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Bundle Extension for Siren - -extension Bundle { - final class func bundleID() -> String? { - return Bundle.main.bundleIdentifier - } - - final class func sirenBundlePath() -> String? { - return Bundle(for: Siren.self).path(forResource: "Siren", ofType: "bundle") - } - - final class func sirenForcedBundlePath(forceLanguageLocalization: Siren.LanguageType) -> String? { - guard let path = sirenBundlePath() else { return nil } - let name = forceLanguageLocalization.rawValue - - return Bundle(path: path)?.path(forResource: name, ofType: "lproj") - } - - final class func localizedString(forKey key: String, forceLanguageLocalization: Siren.LanguageType?) -> String? { - guard var path = sirenBundlePath() else { return nil } - let table = "SirenLocalizable" - - if let forceLanguageLocalization = forceLanguageLocalization, - let forcedPath = sirenForcedBundlePath(forceLanguageLocalization: forceLanguageLocalization) { - path = forcedPath - } - - return Bundle(path: path)?.localizedString(forKey: key, value: key, table: table) - } - - final class func bestMatchingAppName() -> String { - let bundleDisplayName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String - let bundleName = Bundle.main.object(forInfoDictionaryKey: kCFBundleNameKey as String) as? String - - return bundleDisplayName ?? bundleName ?? "" - } -} - -// MARK: - Bundle Extension for Testing Siren - -extension Bundle { - func testLocalizedString(forKey key: String, forceLanguageLocalization: Siren.LanguageType?) -> String? { - return Bundle.localizedString(forKey: key, forceLanguageLocalization: forceLanguageLocalization) - } -} diff --git a/Sources/Extensions/SirenLocalizationExtension.swift b/Sources/Extensions/SirenLocalizationExtension.swift deleted file mode 100644 index 2d01fb49..00000000 --- a/Sources/Extensions/SirenLocalizationExtension.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// SirenLocalizationExtension.swift -// Siren -// -// Created by Arthur Sabintsev on 9/25/18. -// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Helpers (Localization) - -extension Siren { - func localizedUpdateTitle() -> String { - return Bundle.localizedString(forKey: alertMessaging.updateTitle.string, forceLanguageLocalization: forceLanguageLocalization) - ?? alertMessaging.updateTitle.string - } - - func localizedNewVersionMessage() -> String { - let newVersionMessage = Bundle.localizedString(forKey: alertMessaging.updateMessage.string, - forceLanguageLocalization: forceLanguageLocalization) - ?? alertMessaging.updateMessage.string - - guard let currentAppStoreVersion = currentAppStoreVersion else { - return String(format: newVersionMessage, appName, "Unknown") - } - - return String(format: newVersionMessage, appName, currentAppStoreVersion) - } - - func localizedUpdateButtonTitle() -> String? { - return Bundle.localizedString(forKey: alertMessaging.updateButtonMessage.string, - forceLanguageLocalization: forceLanguageLocalization) - ?? alertMessaging.updateButtonMessage.string - } - - func localizedNextTimeButtonTitle() -> String? { - return Bundle.localizedString(forKey: alertMessaging.nextTimeButtonMessage.string, - forceLanguageLocalization: forceLanguageLocalization) - ?? alertMessaging.nextTimeButtonMessage.string - } - - func localizedSkipButtonTitle() -> String? { - return Bundle.localizedString(forKey: alertMessaging.skipVersionButtonMessage.string, - forceLanguageLocalization: forceLanguageLocalization) - ?? alertMessaging.skipVersionButtonMessage.string - } -} diff --git a/Sources/Extensions/SirenUIAlertControllerExtension.swift b/Sources/Extensions/SirenUIAlertControllerExtension.swift deleted file mode 100644 index c824b506..00000000 --- a/Sources/Extensions/SirenUIAlertControllerExtension.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// SirenUIAlertControllerExtension.swift -// SirenExample -// -// Created by Arthur Sabintsev on 3/17/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation -import UIKit - -// MARK: - UIAlertController Extension for Siren - -extension UIAlertController { - func show() { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = SirenViewController() - window.windowLevel = UIWindow.Level.alert + 1 - - Siren.shared.updaterWindow = window - - window.makeKeyAndVisible() - window.rootViewController?.present(self, animated: true, completion: nil) - } -} diff --git a/Sources/Extensions/UIAlertControllerExtension.swift b/Sources/Extensions/UIAlertControllerExtension.swift new file mode 100644 index 00000000..5dcdec20 --- /dev/null +++ b/Sources/Extensions/UIAlertControllerExtension.swift @@ -0,0 +1,28 @@ +// +// UIAlertControllerExtension.swift +// Siren +// +// Created by Arthur Sabintsev on 3/17/17. +// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation +import UIKit + +// `UIAlertController` Extension for Siren. +extension UIAlertController { + /// Presents Siren's `UIAlertController` in a new `UIWindow`. + /// + /// - Parameter window: The `UIWindow` that _should_ reference Siren's `UIAlertController`. + func show(window: UIWindow) { + window.makeKeyAndVisible() + window.rootViewController?.present(self, animated: true, completion: nil) + } + + /// Hides Siren's `UIAlertController` within a given window. + /// + /// - Parameter window: The `UIWindow` that references Siren's `UIAlertController`. + func hide(window: UIWindow) { + window.isHidden = true + } +} diff --git a/Sources/Extensions/SirenUserDefaultsExtension.swift b/Sources/Extensions/UserDefaultsExtension.swift similarity index 51% rename from Sources/Extensions/SirenUserDefaultsExtension.swift rename to Sources/Extensions/UserDefaultsExtension.swift index f806f540..a92d7c91 100644 --- a/Sources/Extensions/SirenUserDefaultsExtension.swift +++ b/Sources/Extensions/UserDefaultsExtension.swift @@ -1,5 +1,5 @@ // -// SirenUserDefaultsExtension.swift +// UserDefaultsExtension.swift // Siren // // Created by Arthur Sabintsev on 9/25/18. @@ -8,22 +8,22 @@ import Foundation -/// Siren-specific UserDefaults Keys -private enum SirenKeys: String { - /// Key that notifies Siren to perform a version check and present - /// the Siren alert the next time the user launches the app. - case PerformVersionCheckOnSubsequentLaunch - - /// Key that stores the timestamp of the last version check in UserDefaults. - case StoredVersionCheckDate +// `UserDefaults` Extension for Siren. +extension UserDefaults { + /// Siren-specific `UserDefaults` Keys + private enum SirenKeys: String { + /// Key that notifies Siren to perform a version check and present + /// the Siren alert the next time the user launches the app. + case PerformVersionCheckOnSubsequentLaunch - /// Key that stores the version that a user decided to skip in UserDefaults. - case StoredSkippedVersion -} + /// Key that stores the timestamp of the last version check. + case StoredVersionCheckDate -// MARK: - UserDefaults Extension for Siren + /// Key that stores the version that a user decided to skip. + case StoredSkippedVersion + } -extension UserDefaults { + /// Sets and Gets a `UserDefault` around performing a version check on a subsequent launch. static var shouldPerformVersionCheckOnSubsequentLaunch: Bool { get { return standard.bool(forKey: SirenKeys.PerformVersionCheckOnSubsequentLaunch.rawValue) @@ -32,6 +32,7 @@ extension UserDefaults { } } + /// Sets and Gets a `UserDefault` around storing a version that the user wants to skip updating. static var storedSkippedVersion: String? { get { return standard.string(forKey: SirenKeys.StoredSkippedVersion.rawValue) @@ -40,7 +41,8 @@ extension UserDefaults { } } - static var storedVersionCheckDate: Date? { + /// Sets and Gets a `UserDefault` around the last time the user was presented a version update alert. + static var alertPresentationDate: Date? { get { return standard.object(forKey: SirenKeys.StoredVersionCheckDate.rawValue) as? Date } set { diff --git a/Sources/Managers/APIManager.swift b/Sources/Managers/APIManager.swift new file mode 100644 index 00000000..5225630d --- /dev/null +++ b/Sources/Managers/APIManager.swift @@ -0,0 +1,131 @@ +// +// APIManager.swift +// Siren +// +// Created by Arthur Sabintsev on 11/24/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// APIManager for Siren +public struct APIManager { + /// Constants used in the `APIManager`. + private struct Constants { + /// Constant for the `bundleId` parameter in the iTunes Lookup API request. + static let bundleID = "bundleId" + /// Constant for the `country` parameter in the iTunes Lookup API request. + static let country = "country" + } + + /// Return results or errors obtained from performing a version check with Siren. + typealias CompletionHandler = (LookupModel?, KnownError?) -> Void + + /// The region or country of an App Store in which the app is available. + /// By default, all version check requests are performed against the US App Store. + /// If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available. + /// + /// [List of country codes](https://help.apple.com/app-store-connect/#/dev997f9cf7c) + /// + let countryCode: String? + + /// Initializes `APIManager` to the region or country of an App Store in which the app is available. + /// By default, all version check requests are performed against the US App Store. + /// If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available. + /// + /// [List of country codes](https://help.apple.com/app-store-connect/#/dev997f9cf7c) + /// + /// - Parameter countryCode: The country code for the App Store in which the app is availabe. Defaults to nil (e.g., the US App Store) + public init(countryCode: String? = nil) { + self.countryCode = countryCode + } + + /// The default `APIManager`. + /// + /// The version check is performed against the US App Store. + public static let `default` = APIManager() +} + +extension APIManager { + /// Creates and performs a URLRequest against the iTunes Lookup API. + /// + /// - Parameter handler: The completion handler for the iTunes Lookup API request. + func performVersionCheckRequest(completion handler: CompletionHandler?) { + guard Bundle.main.bundleIdentifier != nil else { + handler?(nil, .missingBundleID) + return + } + + do { + let url = try makeITunesURL() + let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 30) + URLSession.shared.dataTask(with: request) { (data, response, error) in + URLCache.shared.removeCachedResponse(for: request) + self.processVersionCheckResults(withData: data, response: response, error: error, completion: handler) + }.resume() + } catch { + handler?(nil, .malformedURL) + } + } + + /// Parses and maps the the results from the iTunes Lookup API request. + /// + /// - Parameters: + /// - data: The JSON data returned from the request. + /// - response: The response metadata returned from the request. + /// - error: The error returned from the request. + /// - handler: The completion handler to call once the results of the request has been processed. + private func processVersionCheckResults(withData data: Data?, + response: URLResponse?, + error: Error?, + completion handler: CompletionHandler?) { + if let error = error { + handler?(nil, .appStoreDataRetrievalFailure(underlyingError: error)) + } else { + guard let data = data else { + handler?(nil, .appStoreDataRetrievalFailure(underlyingError: nil)) + return + } + do { + let lookupModel = try JSONDecoder().decode(LookupModel.self, from: data) + + guard !lookupModel.results.isEmpty else { + handler?(nil, .appStoreDataRetrievalEmptyResults) + return + } + + DispatchQueue.main.async { + handler?(lookupModel, nil) + } + } catch { + handler?(nil, .appStoreJSONParsingFailure(underlyingError: error)) + } + } + } + + /// Creates the URL that points to the iTunes Lookup API. + /// + /// - Returns: The iTunes Lookup API URL. + /// - Throws: An error if the URL cannot be created. + private func makeITunesURL() throws -> URL { + var components = URLComponents() + components.scheme = "https" + components.host = "itunes.apple.com" + components.path = "/lookup" + + var items: [URLQueryItem] = [URLQueryItem(name: Constants.bundleID, value: Bundle.main.bundleIdentifier)] + + if let countryCode = countryCode { + let item = URLQueryItem(name: Constants.country, value: countryCode) + items.append(item) + } + + components.queryItems = items + + guard let url = components.url, !url.absoluteString.isEmpty else { + throw KnownError.malformedURL + } + + return url + } +} diff --git a/Sources/Managers/PresentationManager.swift b/Sources/Managers/PresentationManager.swift new file mode 100644 index 00000000..903f4ff3 --- /dev/null +++ b/Sources/Managers/PresentationManager.swift @@ -0,0 +1,219 @@ +// +// PresentationManager.swift +// Siren +// +// Created by Arthur Sabintsev on 12/6/17. +// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// PresentationManager for Siren +public struct PresentationManager { + /// Return results or errors obtained from performing a version check with Siren. + typealias CompletionHandler = (AlertAction) -> Void + + /// The localization data structure that will be used to construct localized strings for the update alert. + let localization: Localization + + /// The tint color of the `UIAlertController` buttons. + let tintColor: UIColor? + + /// The descriptive update message of the `UIAlertController`. + let alertMessage: String + + /// The main message of the `UIAlertController`. + let alertTitle: String + + /// The "Next time" button text of the `UIAlertController`. + let nextTimeButtonTitle: String + + /// The "Skip this version" button text of the `UIAlertController`. + let skipButtonTitle: String + + /// The "Update" button text of the `UIAlertController`. + let updateButtonTitle: String + + /// The instance of the `UIAlertController` used to present the update alert. + private var alertController: UIAlertController? + + /// The `UIWindow` instance that presents the `SirenViewController`. + private var updaterWindow: UIWindow { + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = SirenViewController() + window.windowLevel = UIWindow.Level.alert + 1 + return window + } + + /// `PresentationManager`'s public initializer. + /// + /// - Parameters: + /// - tintColor: The alert's tintColor. Settings this to `nil` defaults to the system default color. + /// - appName: The name of the app (overrides the default/bundled name). + /// - alertTitle: The title field of the `UIAlertController`. + /// - alertMessage: The `message` field of the `UIAlertController`. + /// - nextTimeButtonTitle: The `title` field of the Next Time Button `UIAlertAction`. + /// - skipButtonTitle: The `title` field of the Skip Button `UIAlertAction`. + /// - updateButtonTitle: The `title` field of the Update Button `UIAlertAction`. + /// - forceLanguage: The language the alert to which the alert should be set. If `nil`, it falls back to the device's preferred locale. + public init(alertTintColor tintColor: UIColor? = nil, + appName: String? = nil, + alertTitle: String = AlertConstants.alertTitle, + alertMessage: String = AlertConstants.alertMessage, + updateButtonTitle: String = AlertConstants.updateButtonTitle, + nextTimeButtonTitle: String = AlertConstants.nextTimeButtonTitle, + skipButtonTitle: String = AlertConstants.skipButtonTitle, + forceLanguageLocalization forceLanguage: Localization.Language? = nil) { + self.alertTitle = alertTitle + self.alertMessage = alertMessage + self.localization = Localization(appName: appName, andForceLanguageLocalization: forceLanguage) + self.nextTimeButtonTitle = nextTimeButtonTitle + self.updateButtonTitle = updateButtonTitle + self.skipButtonTitle = skipButtonTitle + self.tintColor = tintColor + } + + /// The default `PresentationManager`. + /// + /// By default: + /// - There is no tint color (defaults to Apple's system `blue` color.) + /// - The name of the app is equal to the name that appears in `Info.plist`. + /// - The strings are all set to that of the user's device localization (if supported) or it falls back to English. + public static let `default` = PresentationManager() +} + +extension PresentationManager { + + /// Constructs the localized update alert `UIAlertController` object. + /// + /// - Parameters: + /// - rules: The rules that are used to define the type of alert that should be presented. + /// - currentAppStoreVersion: The current version of the app in the App Store. + /// - handler: The completion handler that returns the an `AlertAction` depending on the type of action the end-user took. + mutating func presentAlert(withRules rules: Rules, + forCurrentAppStoreVersion currentAppStoreVersion: String, + completion handler: CompletionHandler?) { + UserDefaults.alertPresentationDate = Date() + + // Alert Title + let alertTitle: String + if self.alertTitle == AlertConstants.alertTitle { + alertTitle = localization.alertTitle() + } else { + alertTitle = self.alertTitle + } + + // Alert Message + let alertMessage: String + if self.alertMessage == AlertConstants.alertMessage { + alertMessage = localization.alertMessage(forCurrentAppStoreVersion: currentAppStoreVersion) + } else { + alertMessage = self.alertMessage + } + + alertController = UIAlertController(title: alertTitle, + message: alertMessage, + preferredStyle: .alert) + + if let tintColor = tintColor { + alertController?.view.tintColor = tintColor + } + + switch rules.alertType { + case .force: + alertController?.addAction(updateAlertAction(completion: handler)) + case .option: + + alertController?.addAction(updateAlertAction(completion: handler)) + alertController?.addAction(nextTimeAlertAction(completion: handler)) + case .skip: + alertController?.addAction(updateAlertAction(completion: handler)) + alertController?.addAction(nextTimeAlertAction(completion: handler)) + alertController?.addAction(skipAlertAction(forCurrentAppStoreVersion: currentAppStoreVersion, completion: handler)) + case .none: + handler?(.unknown) + } + + // If the alertType is .none, an alert will not be presneted. + // If the `updaterWindow` is not hidden, than an alert is already presented. + // The latter prevents `UIAlertControllers` from appearing on top of each other. + if rules.alertType != .none && updaterWindow.isHidden { + alertController?.show(window: updaterWindow) + } + } + + /// The `UIAlertAction` that is executed when the `Update` option is selected. + /// + /// - Parameters: + /// - handler: The completion handler that returns the `.update` option. + /// - Returns: The `Update` alert action. + private func updateAlertAction(completion handler: CompletionHandler?) -> UIAlertAction { + let title: String + if self.updateButtonTitle == AlertConstants.updateButtonTitle { + title = localization.updateButtonTitle() + } else { + title = self.updateButtonTitle + } + + let action = UIAlertAction(title: title, style: .default) { _ in + self.alertController?.hide(window: self.updaterWindow) + Siren.shared.launchAppStore() + + handler?(.appStore) + return + } + + return action + } + + /// The `UIAlertAction` that is executed when the `Next time` option is selected. + /// + /// - Parameters: + /// - handler: The completion handler that returns the `.nextTime` option. + /// - Returns: The `Next time` alert action. + private func nextTimeAlertAction(completion handler: CompletionHandler?) -> UIAlertAction { + let title: String + if self.nextTimeButtonTitle == AlertConstants.nextTimeButtonTitle { + title = localization.nextTimeButtonTitle() + } else { + title = self.nextTimeButtonTitle + } + + let action = UIAlertAction(title: title, style: .default) { _ in + self.alertController?.hide(window: self.updaterWindow) + UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch = true + + handler?(.nextTime) + return + } + + return action + } + + /// The `UIAlertAction` that is executed when the `Skip this version` option is selected. + /// + /// - Parameters: + /// - currentAppStoreVersion: The current version of the app in the App Store. + /// - handler: The completion handler that returns the `.skip` option. + /// - Returns: The `Skip this version` alert action. + private func skipAlertAction(forCurrentAppStoreVersion currentAppStoreVersion: String, completion handler: CompletionHandler?) -> UIAlertAction { + let title: String + if self.skipButtonTitle == AlertConstants.skipButtonTitle { + title = localization.skipButtonTitle() + } else { + title = self.skipButtonTitle + } + + let action = UIAlertAction(title: title, style: .default) { _ in + UserDefaults.storedSkippedVersion = currentAppStoreVersion + UserDefaults.standard.synchronize() + + self.alertController?.hide(window: self.updaterWindow) + + handler?(.skip) + return + } + + return action + } +} diff --git a/Sources/Managers/RulesManager.swift b/Sources/Managers/RulesManager.swift new file mode 100644 index 00000000..6c8f9699 --- /dev/null +++ b/Sources/Managers/RulesManager.swift @@ -0,0 +1,125 @@ +// +// RulesManager.swift +// Siren +// +// Created by Arthur Sabintsev on 12/1/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// RulesManager for Siren +public struct RulesManager { + /// The alert will only show up if the current version has already been released for X days. + /// + /// This value defaults to 1 day (in `RulesManager`'s initializer) to avoid an issue where + /// Apple updates the JSON faster than the app binary propogates to the App Store. + let releasedForDays: Int + + /// The `Rules` that should be used when the App Store version of the app signifies that it is a **major** version update (A.b.c.d). + var majorUpdateRules: Rules + + /// The `Rules` that should be used when the App Store version of the app signifies that it is a **minor** version update (a.B.c.d). + var minorUpdateRules: Rules + + /// The `Rules` that should be used when the App Store version of the app signifies that it is a **patch** version update (a.b.C.d). + var patchUpdateRules: Rules + + /// The `Rules` that should be used when the App Store version of the app signifies that it is a **revision** version update (a.b.c.D). + var revisionUpdateRules: Rules + + /// Initializer that sets update-specific `Rules` for all updates (e.g., major, minor, patch, revision). + /// This means that each of the four update types can have their own specific update rules. + /// + /// By default, the `releasedForDays` parameter delays the update alert from being presented for _1 day_ + /// to avoid an issue where the _iTunes Lookup_ API response is updated faster than the time it takes for the binary + /// to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the _1 day_ delay. + /// + /// - Warning: Setting `releasedForDays` to _0 days_ causes the alert to appear right away, even if the binary isn't available. + /// If this value is set to _0 days_, and an `AlertType` of type `.force` is set, it will cause your app to infinitely send the + /// end-user to the App Store to download a version that's not there and lock them out of your application until the binary is + /// is available to be downloaded. + /// + /// - Parameters: + /// - rules: The rules that should be set for all version updates. + /// - releasedForDays: The amount of time (in days) that the app should delay before presenting the user + public init(majorUpdateRules: Rules = .default, + minorUpdateRules: Rules = .default, + patchUpdateRules: Rules = .default, + revisionUpdateRules: Rules = .default, + showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1) { + self.majorUpdateRules = majorUpdateRules + self.minorUpdateRules = minorUpdateRules + self.patchUpdateRules = patchUpdateRules + self.revisionUpdateRules = revisionUpdateRules + self.releasedForDays = releasedForDays + } + + /// Initializer that sets the same update `Rules` for all types of updates (e.g., major, minor, patch, revision). + /// This means that all four update types will use the same presentation rules. + /// + /// By default, the `releasedForDays` parameter delays the update alert from being presented for _1 day_ + /// to avoid an issue where the _iTunes Lookup_ API response is updated faster than the time it takes for the binary + /// to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the _1 day_ delay. + /// + /// - Warning: Setting `releasedForDays` to _0 days_ causes the alert to appear right away, even if the binary isn't available. + /// If this value is set to _0 days_, and an `AlertType` of type `.force` is set, it will cause your app to infinitely send the + /// end-user to the App Store to download a version that's not there and lock them out of your application until the binary is + /// is available to be downloaded. + /// + /// - Parameters: + /// - rules: The rules that should be set for all version updates. + /// - releasedForDays: The amount of time (in days) that the app should delay before presenting the user + public init(globalRules rules: Rules = .default, + showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1) { + self.init(majorUpdateRules: rules, + minorUpdateRules: rules, + patchUpdateRules: rules, + revisionUpdateRules: rules, + showAlertAfterCurrentVersionHasBeenReleasedForDays: releasedForDays) + } + + /// Returns the appropriate update rules based on the type of version that is returned from the API. + /// + /// - Parameter type: The type of app update. + /// - Returns: The appropriate rule based on the type of app update that is returned by the API. + func loadRulesForUpdateType(_ type: UpdateType) -> Rules { + switch type { + case .major: return majorUpdateRules + case .minor: return minorUpdateRules + case .patch: return patchUpdateRules + case .revision: return revisionUpdateRules + case .unknown: return majorUpdateRules + } + } + + /// The default `RulesManager`. + /// + /// By default, the `Rules.default` rule is used for all update typs. + public static let `default` = RulesManager(globalRules: .default) +} + +// MARK: - RulesManager-related Constants + +extension RulesManager { + /// Informs Siren of the type of update that is available so that + /// the appropriate ruleset is used to present the update alert. + /// + /// - major: Major release available: A.b.c.d + /// - minor: Minor release available: a.B.c.d + /// - patch: Patch release available: a.b.C.d + /// - revision: Revision release available: a.b.c.D + /// - unknown: No information available about the update. + public enum UpdateType: String { + /// Major release available: A.b.c.d + case major + /// Minor release available: a.B.c.d + case minor + /// Patch release available: a.b.C.d + case patch + /// Revision release available: a.b.c.D + case revision + /// No information available about the update. + case unknown + } +} diff --git a/Sources/Models/AlertAction.swift b/Sources/Models/AlertAction.swift new file mode 100644 index 00000000..8ac5b224 --- /dev/null +++ b/Sources/Models/AlertAction.swift @@ -0,0 +1,21 @@ +// +// AlertAction.swift +// Siren +// +// Created by Arthur Sabintsev on 12/1/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// The `UIAlertController` button that was pressed upon being presented an update alert. +public enum AlertAction { + /// The user clicked on the `Update` option, which took them to the app's App Store page. + case appStore + /// The user clicked on the `Next Time` option, which dismissed the alert. + case nextTime + /// The user clicked on the `Skip this version` option, which dismissed the alert. + case skip + /// (Default) The user never chose an option. This is returned when an error is thrown by Siren. + case unknown +} diff --git a/Sources/Models/AlertConstants.swift b/Sources/Models/AlertConstants.swift new file mode 100644 index 00000000..91c6a65b --- /dev/null +++ b/Sources/Models/AlertConstants.swift @@ -0,0 +1,27 @@ +// +// AlertConstants.swift +// Siren +// +// Created by Arthur Sabintsev on 12/18/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// The default constants used for the update alert's messaging. +public struct AlertConstants { + /// The text that conveys the message that there is an app update available + public static let alertMessage = "A new version of %@ is available. Please update to version %@ now." + + /// The alert title which defaults to *Update Available*. + public static let alertTitle = "Update Available" + + /// The button text that conveys the message that the user should be prompted to update next time the app launches. + public static let nextTimeButtonTitle = "Next time" + + /// The text that conveys the message that the the user wants to skip this verison update. + public static let skipButtonTitle = "Skip this version" + + /// The button text that conveys the message that the user would like to update the app right away. + public static let updateButtonTitle = "Update" +} diff --git a/Sources/Models/Localization.swift b/Sources/Models/Localization.swift new file mode 100644 index 00000000..a58907e6 --- /dev/null +++ b/Sources/Models/Localization.swift @@ -0,0 +1,166 @@ +// +// Localization.swift +// Siren +// +// Created by Arthur Sabintsev on 9/25/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// Localization information and strings for Siren. +public struct Localization { + /// Determines the available languages in which the update message and alert button titles should appear. + /// + /// By default, the operating system's default lanuage setting is used. However, you can force a specific language + /// by setting the forceLanguageLocalization property before calling checkVersion() + public enum Language: String { + /// Arabic Language Localization + case arabic = "ar" + /// Armenian Language Localization + case armenian = "hy" + /// Basque Language Localization + case basque = "eu" + /// Simplified Chinese Language Localization + case chineseSimplified = "zh-Hans" + /// Traditional Chinese Localization Localization + case chineseTraditional = "zh-Hant" + /// Croatian Language Localization + case croatian = "hr" + /// Czech Language Localization + case czech = "cs" + /// Danish Language Localization + case danish = "da" + /// Dutch Language Localization + case dutch = "nl" + /// English Language Localization + case english = "en" + /// Estonian Language Localization + case estonian = "et" + /// Finnish Language Localization + case finnish = "fi" + /// French Language Localization + case french = "fr" + /// German Language Localization + case german = "de" + /// Greek Language Localization + case greek = "el" + /// Hebrew Language Localization + case hebrew = "he" + /// Hungarian Language Localization + case hungarian = "hu" + /// Indonesian Language Localization + case indonesian = "id" + /// Italian Language Localization + case italian = "it" + /// Japanese Language Localization + case japanese = "ja" + /// Korean Language Localization + case korean = "ko" + /// Latvian Language Localization + case latvian = "lv" + /// Lithuanian Language Localization + case lithuanian = "lt" + /// Malay Language Localization + case malay = "ms" + /// Norwegian Language Localization + case norwegian = "nb-NO" + /// Persian Language Localization + case persian = "fa" + /// Persian (Afghanistan) Language Localization + case persianAfghanistan = "fa-AF" + /// Persian (Iran) Language Localization + case persianIran = "fa-IR" + /// Polish Language Localization + case polish = "pl" + /// Brazilian Portuguese Language Localization + case portugueseBrazil = "pt" + /// Portugal's Portuguese Language Localization + case portuguesePortugal = "pt-PT" + /// Russian Language Localization + case russian = "ru" + /// Serbian (Cyrillic) Language Localization + case serbianCyrillic = "sr-Cyrl" + /// Serbian (Latin) Language Localization + case serbianLatin = "sr-Latn" + /// Slovenian Language Localization + case slovenian = "sl" + /// Spanish Language Localization + case spanish = "es" + /// Swedish Language Localization + case swedish = "sv" + /// Thai Language Localization + case thai = "th" + /// Turkish Language Localization + case turkish = "tr" + /// Urdu Language Localization + case urdu = "ur" + /// Ukranian Language Localization + case ukrainian = "uk" + /// Vietnamese Language Localization + case vietnamese = "vi" + } + + /// The name of the app as defined by the `Info.plist`. + private var appName: String = Bundle.bestMatchingAppName() + + /// Overrides the default localization of a user's device when presenting the update message and button titles in the alert. + /// + /// See the Siren.Localization.Language enum for more details. + private let forceLanguage: Language? + + /// Initializes + /// + /// - Parameters: + /// - appName: Overrides the default name of the app. This is optional and defaults to the app that is defined in the `Info.plist`. + /// - forceLanguage: The language the alert to which the alert should be set. If `nil`, it falls back to the device's preferred locale. + init(appName: String?, andForceLanguageLocalization forceLanguage: Language?) { + if let appName = appName { + self.appName = appName + } + + self.forceLanguage = forceLanguage + } + + /// The localized string for the `UIAlertController`'s message field. . + /// + /// - Returns: A localized string for the update message. + public func alertMessage(forCurrentAppStoreVersion currentAppStoreVersion: String) -> String { + let message = Bundle.localizedString(forKey: AlertConstants.alertMessage, + andForceLocalization: forceLanguage) + + return String(format: message, appName, currentAppStoreVersion) + } + + /// The localized string for the `UIAlertController`'s title field. . + /// + /// - Returns: A localized string for the phrase "Update Available". + public func alertTitle() -> String { + return Bundle.localizedString(forKey: AlertConstants.alertTitle, + andForceLocalization: forceLanguage) + } + + /// The localized string for the "Next time" `UIAlertAction`. + /// + /// - Returns: A localized string for the phrase "Next time". + public func nextTimeButtonTitle() -> String { + return Bundle.localizedString(forKey: AlertConstants.nextTimeButtonTitle, + andForceLocalization: forceLanguage) + } + + /// The localized string for the "Skip this version" `UIAlertAction`. + /// + /// - Returns: A localized string for the phrase "Skip this version". + public func skipButtonTitle() -> String { + return Bundle.localizedString(forKey: AlertConstants.skipButtonTitle, + andForceLocalization: forceLanguage) + } + + /// The localized string for the "Update" `UIAlertAction`. + /// + /// - Returns: A localized string for the phrase "Update". + public func updateButtonTitle() -> String { + return Bundle.localizedString(forKey: AlertConstants.updateButtonTitle, + andForceLocalization: forceLanguage) + } +} diff --git a/Sources/Models/SirenLookupModel.swift b/Sources/Models/LookupModel.swift similarity index 65% rename from Sources/Models/SirenLookupModel.swift rename to Sources/Models/LookupModel.swift index 58a02c6e..85cc6454 100644 --- a/Sources/Models/SirenLookupModel.swift +++ b/Sources/Models/LookupModel.swift @@ -1,5 +1,5 @@ // -// SirenLookupModel.swift +// LookupModel.swift // Siren // // Created by Arthur Sabintsev on 8/6/17. @@ -8,11 +8,11 @@ import Foundation -// MARK: - Model representing a selection of results from the iTunes Lookup API - -/// MARK: Siren extension used to parse and map the iTunes JSON results into a model represented in Swift. -public struct SirenLookupModel: Decodable { +/// Model representing a selection of results from the iTunes Lookup API. +public struct LookupModel: Decodable { + /// Codable Coding Keys for the Top-Level iTunes Lookup API JSON response. private enum CodingKeys: String, CodingKey { + /// The results JSON key. case results } @@ -21,11 +21,17 @@ public struct SirenLookupModel: Decodable { /// The Results object from the the iTunes Lookup API. public struct Results: Decodable { + /// Codable Coding Keys for the Results array in the iTunes Lookup API JSON response. private enum CodingKeys: String, CodingKey { + /// The appID JSON key. case appID = "trackId" + /// The current version release date JSON key. case currentVersionReleaseDate + /// The minimum device iOS version compatibility JSON key. case minimumOSVersion = "minimumOsVersion" + /// The release notes JSON key. case releaseNotes + /// The current App Store version JSON key. case version } diff --git a/Sources/Models/Results.swift b/Sources/Models/Results.swift new file mode 100644 index 00000000..57cb6f3e --- /dev/null +++ b/Sources/Models/Results.swift @@ -0,0 +1,25 @@ +// +// Results.swift +// Siren +// +// Created by Arthur Sabintsev on 12/1/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// The relevant metadata returned from Siren upon completing a successful version check. +public struct Results { + /// The `UIAlertAction` the user chose upon being presented with the update alert. + /// Defaults to `unknown` until an alert is actually presented. + public var alertAction: AlertAction = .unknown + + /// The Siren-supported locale that was used for the string in the update alert. + public var localization: Localization + + /// The Swift-mapped API model, if a successful version check was performed. + public var lookupModel: LookupModel + + /// The type of update that was returned for the API. + public var updateType: RulesManager.UpdateType = .unknown +} diff --git a/Sources/Models/Rules.swift b/Sources/Models/Rules.swift new file mode 100644 index 00000000..e01cc282 --- /dev/null +++ b/Sources/Models/Rules.swift @@ -0,0 +1,86 @@ +// +// Rules.swift +// Siren +// +// Created by Sabintsev, Arthur on 11/18/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// Alert Presentation Rules for Siren. +public struct Rules { + /// The type of alert that should be presented. + let alertType: AlertType + + /// The frequency in which a the user is prompted to update the app + /// once a new version is available in the App Store and if they have not updated yet. + let frequency: UpdatePromptFrequency + + /// Initializes the alert presentation rules. + /// + /// - Parameters: + /// - frequency: How often a user should be prompted to update the app once a new version is available in the App Store. + /// - alertType: The type of alert that should be presented. + public init(promptFrequency frequency: UpdatePromptFrequency, + forAlertType alertType: AlertType) { + self.frequency = frequency + self.alertType = alertType + } + + /// Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active. + public static var annoying: Rules { + return Rules(promptFrequency: .immediately, forAlertType: .option) + } + + /// Performs a version check immediately and forces the user to update the app. + public static var critical: Rules { + return Rules(promptFrequency: .immediately, forAlertType: .force) + } + + /// Performs a version check once a day, but allows the user to skip updating the app until + /// the next time the app becomes active or skipping the update all together until another version is released. + /// + /// This is the default setting. + public static var `default`: Rules { + return Rules(promptFrequency: .daily, forAlertType: .skip) + } + + /// Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active. + public static var persistent: Rules { + return Rules(promptFrequency: .daily, forAlertType: .option) + } + + /// Performs a version check weekly, but allows the user to skip updating the app until + /// the next time the app becomes active or skipping the update all together until another version is released. + public static var relaxed: Rules { + return Rules(promptFrequency: .weekly, forAlertType: .skip) + } +} + +// Rules-related Constants +public extension Rules { + /// Determines the type of alert to present after a successful version check has been performed. + public enum AlertType { + /// Forces the user to update your app (1 button alert). + case force + /// Presents the user with option to update app now or at next launch (2 button alert). + case option + /// Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert). + case skip + /// Doesn't present the alert. + /// Use this option if you would like to present a custom alert to the end-user. + case none + } + + /// Determines the frequency in which the user is prompted to update the app + /// once a new version is available in the App Store and if they have not updated yet. + public enum UpdatePromptFrequency: UInt { + /// Version check performed every time the app is launched. + case immediately = 0 + /// Version check performed once a day. + case daily = 1 + /// Version check performed once a week. + case weekly = 7 + } +} diff --git a/Sources/Models/SirenAlertMessaging.swift b/Sources/Models/SirenAlertMessaging.swift deleted file mode 100644 index ca27dbc8..00000000 --- a/Sources/Models/SirenAlertMessaging.swift +++ /dev/null @@ -1,64 +0,0 @@ -// -// SirenAlertMessaging.swift -// Siren -// -// Created by Arthur Sabintsev on 12/6/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Siren Alert Messaging Customization - -/// Allows the overriding of all the `UIAlertController` and `UIActionSheet` Strings to which Siren defaults. -/// -/// - Warning: Overriding any of these keys will result in the loss of the built-in internationalization that Siren provides. -/// -/// As `SirenAlertMessaging` is a Struct, one _or_ more keys can be modified. Overriding only one string will result in the other keys retaining their default (and internationalizable) values. -public struct SirenAlertMessaging { - - /// The default constants used for the alert messaging. - public struct Constants { - - /// The button text that conveys the message that the user should be prompted to update next time the app launches. - public static let nextTime = NSAttributedString(string: "Next time") - - /// The text that conveys the message that the the user wants to skip this verison update. - public static let skipVersion = NSAttributedString(string: "Skip this version") - - /// The text that conveys the message that there is an app update available - public static let updateMessage = NSAttributedString(string: "A new version of %@ is available. Please update to version %@ now.") - - /// The alert title which defaults to *Update Available*. - public static let updateTitle = NSAttributedString(string: "Update Available") - - /// The button text that conveys the message that the user would like to update the app right away. - public static let updateNow = NSAttributedString(string: "Update") - } - - let nextTimeButtonMessage: NSAttributedString - let skipVersionButtonMessage: NSAttributedString - let updateButtonMessage: NSAttributedString - let updateMessage: NSAttributedString - let updateTitle: NSAttributedString - - /// The public initializer - /// - /// - Parameters: - /// - title: The title field of the `UIAlertController`. - /// - message: The `message` field of the `UIAlertController`. - /// - updateButtonMessage: The `title` field of the Update Button `UIAlertAction`. - /// - nextTimeButtonMessage: The `title` field of the Next Time Button `UIAlertAction`. - /// - skipVersionButtonMessage: The `title` field of the Skip Button `UIAlertAction`. - public init(updateTitle title: NSAttributedString = Constants.updateTitle, - updateMessage message: NSAttributedString = Constants.updateMessage, - updateButtonMessage: NSAttributedString = Constants.updateNow, - nextTimeButtonMessage: NSAttributedString = Constants.nextTime, - skipVersionButtonMessage: NSAttributedString = Constants.skipVersion) { - self.updateTitle = title - self.nextTimeButtonMessage = nextTimeButtonMessage - self.updateButtonMessage = updateButtonMessage - self.updateMessage = message - self.skipVersionButtonMessage = skipVersionButtonMessage - } -} diff --git a/Sources/Protocols/SirenDelegate.swift b/Sources/Protocols/SirenDelegate.swift deleted file mode 100644 index d7902f58..00000000 --- a/Sources/Protocols/SirenDelegate.swift +++ /dev/null @@ -1,110 +0,0 @@ -// -// SirenDelegate.swift -// SirenExample -// -// Created by Arthur Sabintsev on 4/8/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -/// MARK - Siren UpdateType - -/// `UpdateType` defines what kind of update is available. -/// It is used as parameter if user wants to use -/// custom alert to inform the user about an update. -/// -/// - major: Major release available: A.b.c.d -/// - minor: Minor release available: a.B.c.d -/// - patch: Patch release available: a.b.C.d -/// - revision: Revision release available: a.b.c.D -/// - unknown: No information available about the update. -public enum UpdateType: String { - /// Major release available: A.b.c.d - case major - /// Minor release available: a.B.c.d - case minor - /// Patch release available: a.b.C.d - case patch - /// Revision release available: a.b.c.D - case revision - /// No information available about the update. - case unknown -} - -// MARK: - SirenDelegate Protocol - -/// Delegate that handles all codepaths for Siren upon version check completion. -public protocol SirenDelegate: NSObjectProtocol { - /// Siren performed a version check and did not display an alert. - func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType) - - /// Siren failed to perform version check. - /// - /// - Note: - /// Depending on the reason for failure, - /// a system-level error may be returned. - func sirenDidFailVersionCheck(error: Error) - - /// User presented with an update dialog. - /// - /// - Parameter alertType: The type of alert that was presented. - func sirenDidShowUpdateDialog(alertType: Siren.AlertType) - - /// Siren performed a version check and the latest version was already installed. - func sirenLatestVersionInstalled() - - /// Provides the decoded JSON information from a successful version check call. - /// - /// - Parameter lookupModel: The `Decodable` model representing the JSON results from the iTunes Lookup API. - func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel) - - /// User did click on button that cancels update dialog. - func sirenUserDidCancel() - - /// User did click on button that launched "App Store.app". - func sirenUserDidLaunchAppStore() - - /// User did click on button that skips version update. - func sirenUserDidSkipVersion() -} - -// MARK: - SirenDelegate Protocol Extension - -public extension SirenDelegate { - func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType) { - printMessage() - } - - func sirenDidFailVersionCheck(error: Error) { - printMessage() - } - - func sirenDidShowUpdateDialog(alertType: Siren.AlertType) { - printMessage() - } - - func sirenLatestVersionInstalled() { - printMessage() - } - - func sirenUserDidCancel() { - printMessage() - } - - func sirenUserDidLaunchAppStore() { - printMessage() - } - - func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel) { - printMessage() - } - - func sirenUserDidSkipVersion() { - printMessage() - } - - private func printMessage(_ function: String = #function) { - SirenLog("The default implementation of \(function) is being called. You can ignore this message if you do not care to implement this method in your `SirenDelegate` conforming structure.") - } -} diff --git a/Sources/Siren.swift b/Sources/Siren.swift index 7b49d499..84ec9b70 100644 --- a/Sources/Siren.swift +++ b/Sources/Siren.swift @@ -8,144 +8,79 @@ import UIKit -// MARK: - Siren - -/// The Siren Class. A singleton that is initialized using the `shared` constant. +/// The Siren Class. public final class Siren: NSObject { + /// Return results or errors obtained from performing a version check with Siren. + public typealias ResultsHandler = (Results?, KnownError?) -> Void - /// Current installed version of your app. - internal var currentInstalledVersion: String? = { - return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String - }() - - /// The error domain for all errors created by Siren. - public let SirenErrorDomain = "Siren Error Domain" - - /// The `SirenDelegate` variable, which should be set if you'd like to be notified of any of specific user interactions or API success/failures. - /// Also set this variable if you'd like to use custom UI for presesnting the update notification. - public weak var delegate: SirenDelegate? + /// The Siren singleton. The main point of entry to the Siren library. + public static let shared = Siren() /// The debug flag, which is disabled by default. - /// When enabled, a stream of print() statements are logged to your console when a version check is performed. - public lazy var debugEnabled = false - - /// Determines the type of alert that should be shown. - /// See the Siren.AlertType enum for full details. - public var alertType: AlertType = .option { - didSet { - majorUpdateAlertType = alertType - minorUpdateAlertType = alertType - patchUpdateAlertType = alertType - revisionUpdateAlertType = alertType - } - } - - /// Determines the type of alert that should be shown for major version updates: A.b.c - /// Defaults to Siren.AlertType.option. - /// See the Siren.AlertType enum for full details. - public lazy var majorUpdateAlertType: AlertType = .option - - /// Determines the type of alert that should be shown for minor version updates: a.B.c - /// Defaults to Siren.AlertType.option. - /// See the Siren.AlertType enum for full details. - public lazy var minorUpdateAlertType: AlertType = .option - - /// Determines the type of alert that should be shown for minor patch updates: a.b.C - /// Defaults to Siren.AlertType.option. - /// See the Siren.AlertType enum for full details. - public lazy var patchUpdateAlertType: AlertType = .option - - /// Determines the type of alert that should be shown for revision updates: a.b.c.D - /// Defaults to Siren.AlertType.option. - /// See the Siren.AlertType enum for full details. - public lazy var revisionUpdateAlertType: AlertType = .option - - /// The name of your app. - /// By default, it's set to the name of the app that's stored in your plist. - public lazy var appName = Bundle.bestMatchingAppName() - - /// Overrides all the Strings to which Siren defaults. - /// Defaults to the values defined in `SirenAlertMessaging.Constants` - public var alertMessaging = SirenAlertMessaging() - - /// The region or country of an App Store in which your app is available. - /// By default, all version checks are performed against the US App Store. - /// If your app is not available in the US App Store, set it to the identifier of at least one App Store within which it is available. - public var countryCode: String? - - /// Overrides the default localization of a user's device when presenting the update message and button titles in the alert. - /// See the Siren.LanguageType enum for more details. - public var forceLanguageLocalization: Siren.LanguageType? + /// When enabled, a stream of `print()` statements are logged to your console when a version check is performed. + public lazy var debugEnabled: Bool = false - /// Overrides the tint color for UIAlertController. - public var alertControllerTintColor: UIColor? + /// The manager that controls the App Store API that is + /// used to fetch the latest version of the app. + /// + /// Defaults to the US App Store. + public lazy var apiManager: APIManager = .default - /// When this is set, the alert will only show up if the current version has already been released for X days. - /// Defaults to 1 day to avoid an issue where Apple updates the JSON faster than the app binary propogates to the App Store. - public var showAlertAfterCurrentVersionHasBeenReleasedForDays: Int = 1 + /// The manager that controls the update alert's string localization and tint color. + /// + /// Defaults the string's lange localization to the user's device localization. + public lazy var presentationManager: PresentationManager = .default - /// The current version of your app that is available for download on the App Store - public internal(set) var currentAppStoreVersion: String? + /// The manager that controls the type of alert that should be displayed + /// and how often an alert should be displayed dpeneding on the type + /// of update that is available relative to the installed version of the app + /// (e.g., different rules for major, minor, patch and revision updated can be used). + /// + /// Defaults to performing a version check once a day with an alert that allows + /// the user to skip updating the app until the next time the app becomes active or + /// skipping the update all together until another version is released. + public lazy var rulesManager: RulesManager = .default - /// The `UIWindow` instance that presents the `SirenAlertViewController`. - var updaterWindow: UIWindow? + /// The current installed version of your app. + lazy var currentInstalledVersion: String? = Bundle.version() - /// The last Date that a version check was performed. - var lastVersionCheckPerformedOnDate: Date? + /// The retained `NotificationCenter` observer that listens for `UIApplication.didBecomeActiveNotification` notifications. + var didBecomeActiveObserver: NSObjectProtocol? - fileprivate var appID: Int? - fileprivate lazy var alertViewIsVisible: Bool = false + /// The last date that an alert was presented to the user. + private var alertPresentationDate: Date? - /// Type of the available update - fileprivate var updateType: UpdateType = .unknown + /// The App Store's unique identifier for an app. + private var appID: Int? - /// The App's Singleton - public static let shared = Siren() + /// The completion handler used to return the results or errors returned by Siren. + private var resultsHandler: ResultsHandler? - override init() { - lastVersionCheckPerformedOnDate = UserDefaults.storedVersionCheckDate + /// The initialization method. + private override init() { + alertPresentationDate = UserDefaults.alertPresentationDate } +} - /// Checks the currently installed version of your app against the App Store. - /// The default check is against the US App Store, but if your app is not listed in the US, - /// you should set the `countryCode` property before calling this method. Please refer to the countryCode property for more information. - /// - /// - Parameters: - /// - checkType: The frequency in days in which you want a check to be performed. Please refer to the Siren.VersionCheckType enum for more details. - public func checkVersion(checkType: VersionCheckType) { - updateType = .unknown - - guard Bundle.bundleID() != nil else { - printMessage("Please make sure that you have set a `Bundle Identifier` in your project.") - return - } - - if checkType == .immediately { - performVersionCheck() - } else if UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch { - UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch = false - performVersionCheck() - } else { - guard let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate else { - performVersionCheck() - return - } +// MARK: - Public Functionality - if Date.days(since: lastVersionCheckPerformedOnDate) >= checkType.rawValue { - performVersionCheck() - } else { - postError(.recentlyCheckedAlready) - } - } +public extension Siren { + /// + /// + /// - Parameter handler: + func wail(completion handler: ResultsHandler? = nil) { + resultsHandler = handler + addObservers() } - /// Launches the AppStore in two situations: - /// - /// - User clicked the `Update` button in the UIAlertController modal. - /// - Developer built a custom alert modal and needs to be able to call this function when the user chooses to update the app in the aforementioned custom modal. - public func launchAppStore() { + /// Launches the AppStore in two situations when the user clicked the `Update` button in the UIAlertController modal. + /// + /// This function is marked `public` as a convenience for those developers who decide to build a custom alert modal + /// instead of using Siren's prebuilt update alert. + func launchAppStore() { guard let appID = appID, let url = URL(string: "https://itunes.apple.com/app/id\(appID)") else { + resultsHandler?(nil, .malformedURL) return } @@ -159,233 +94,145 @@ public final class Siren: NSObject { } } -// MARK: - Networking +// MARK: - Private Functionality -private extension Siren { +extension Siren { + /// Initiates the uni-directional version checking flow. func performVersionCheck() { - do { - let url = try iTunesURLFromString() - let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 30) - URLCache.shared.removeCachedResponse(for: request) - URLSession.shared.dataTask(with: request, completionHandler: { [weak self] (data, response, error) in - self?.processResults(withData: data, response: response, error: error) - }).resume() - } catch { - postError(.malformedURL) - } - } - - func processResults(withData data: Data?, response: URLResponse?, error: Error?) { - if let error = error { - postError(.appStoreDataRetrievalFailure(underlyingError: error)) - } else { - guard let data = data else { - return postError(.appStoreDataRetrievalFailure(underlyingError: nil)) - } - do { - let decodedData = try JSONDecoder().decode(SirenLookupModel.self, from: data) - - guard !decodedData.results.isEmpty else { - return postError(.appStoreDataRetrievalEmptyResults) - } - - DispatchQueue.main.async { [weak self] in - guard let self = self else { return } - - self.printMessage("Decoded JSON results: \(decodedData)") - self.delegate?.sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: decodedData) - self.processVersionCheck(with: decodedData) - } - } catch { - postError(.appStoreJSONParsingFailure(underlyingError: error)) + alertPresentationDate = UserDefaults.alertPresentationDate + apiManager.performVersionCheckRequest { [weak self] (lookupModel, error) in + guard let self = self else { return } + guard let lookupModel = lookupModel, error == nil else { + self.resultsHandler?(nil, error) + return } + + self.validate(model: lookupModel) } } - func processVersionCheck(with model: SirenLookupModel) { - guard isUpdateCompatibleWithDeviceOS(for: model) else { return } + /// Validates the parsed and mapped iTunes Lookup Model + /// to guarantee all the relevant data was returned before + /// attempting to present an alert. + /// + /// - Parameter model: The iTunes Lookup Model. + func validate(model: LookupModel) { + // Check if the latest version is compatible with current device's version of iOS. + guard DataParser.isUpdateCompatibleWithDeviceOS(for: model) else { + resultsHandler?(nil, .appStoreOSVersionUnsupported) + return + } + // Check and store the App ID . guard let appID = model.results.first?.appID else { - return postError(.appStoreAppIDFailure) + resultsHandler?(nil, .appStoreAppIDFailure) + return } - self.appID = appID + // Check and store the current App Store version. guard let currentAppStoreVersion = model.results.first?.version else { - return postError(.appStoreVersionArrayFailure) + resultsHandler?(nil, .appStoreVersionArrayFailure) + return } - self.currentAppStoreVersion = currentAppStoreVersion - - guard isAppStoreVersionNewer() else { - delegate?.sirenLatestVersionInstalled() - postError(.noUpdateAvailable) + // Check if the App Store version is newer than the currently installed version. + guard DataParser.isAppStoreVersionNewer(installedVersion: currentInstalledVersion, + appStoreVersion: currentAppStoreVersion) else { + resultsHandler?(nil, .noUpdateAvailable) return } + // Check the release date of the current version. guard let currentVersionReleaseDate = model.results.first?.currentVersionReleaseDate, let daysSinceRelease = Date.days(since: currentVersionReleaseDate) else { - return - } - - guard daysSinceRelease >= showAlertAfterCurrentVersionHasBeenReleasedForDays else { - let message = "Your app has been released for \(daysSinceRelease) days, but Siren cannot prompt the user until \(showAlertAfterCurrentVersionHasBeenReleasedForDays) days have passed." - self.printMessage(message) - return - } - - showAlertIfCurrentAppStoreVersionNotSkipped() - } - - func iTunesURLFromString() throws -> URL { - var components = URLComponents() - components.scheme = "https" - components.host = "itunes.apple.com" - components.path = "/lookup" - - var items: [URLQueryItem] = [URLQueryItem(name: "bundleId", value: Bundle.bundleID())] - - if let countryCode = countryCode { - let item = URLQueryItem(name: "country", value: countryCode) - items.append(item) - } - - components.queryItems = items - - guard let url = components.url, !url.absoluteString.isEmpty else { - throw SirenError.Known.malformedURL + resultsHandler?(nil, .currentVersionReleaseDate) + return } - return url - } -} - -// MARK: - Alert - -private extension Siren { - func showAlertIfCurrentAppStoreVersionNotSkipped() { - alertType = setAlertType() - - guard let previouslySkippedVersion = UserDefaults.storedSkippedVersion else { - showAlert() + // Check if applicaiton has been released for the amount of days defined by the app consuming Siren. + guard daysSinceRelease >= rulesManager.releasedForDays else { + resultsHandler?(nil, .releasedTooSoon(daysSinceRelease: daysSinceRelease, + releasedForDays: rulesManager.releasedForDays)) return } - if let currentAppStoreVersion = currentAppStoreVersion, currentAppStoreVersion != previouslySkippedVersion { - showAlert() - } - } - - func showAlert() { - storeVersionCheckDate() - - let updateAvailableMessage = localizedUpdateTitle() - let newVersionMessage = localizedNewVersionMessage() - - let alertController = UIAlertController(title: updateAvailableMessage, message: newVersionMessage, preferredStyle: .alert) - - if let alertControllerTintColor = alertControllerTintColor { - alertController.view.tintColor = alertControllerTintColor - } - - switch alertType { - case .force: - alertController.addAction(updateAlertAction()) - case .option: - alertController.addAction(nextTimeAlertAction()) - alertController.addAction(updateAlertAction()) - case .skip: - alertController.addAction(nextTimeAlertAction()) - alertController.addAction(updateAlertAction()) - alertController.addAction(skipAlertAction()) - case .none: - let updateTitle = localizedUpdateTitle() - delegate?.sirenDidDetectNewVersionWithoutAlert(title: updateTitle, message: newVersionMessage, updateType: updateType) - } - - if alertType != .none && !alertViewIsVisible { - alertController.show() - alertViewIsVisible = true - delegate?.sirenDidShowUpdateDialog(alertType: alertType) - } + determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion: currentAppStoreVersion, andLookupModel: model) } - func updateAlertAction() -> UIAlertAction { - let title = localizedUpdateButtonTitle() - let action = UIAlertAction(title: title, style: .default) { [weak self] _ in - guard let self = self else { return } - - self.hideWindow() - self.launchAppStore() - self.delegate?.sirenUserDidLaunchAppStore() - self.alertViewIsVisible = false - return + /// Determines if the update alert can be presented based on the + /// rules set in the `RulesManager` and the the skip version settings. + /// + /// - Parameters: + /// - currentAppStoreVersion: The curren version of the app in the App Store. + /// - model: The iTunes Lookup Model. + func determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion currentAppStoreVersion: String, andLookupModel model: LookupModel) { + // Did the user: + // - request to skip being prompted with version update alerts for a specific version + // - and is the latest App Store update the same version that was requested? + if let previouslySkippedVersion = UserDefaults.storedSkippedVersion, + let currentInstalledVersion = currentInstalledVersion, + !currentAppStoreVersion.isEmpty, + currentAppStoreVersion != previouslySkippedVersion { + resultsHandler?(nil, .skipVersionUpdate(installedVersion: currentInstalledVersion, appStoreVersion: currentAppStoreVersion)) + return } - return action - } + let updateType = DataParser.parseForUpdate(forInstalledVersion: currentInstalledVersion, + andAppStoreVersion: currentAppStoreVersion) + let rules = rulesManager.loadRulesForUpdateType(updateType) - func nextTimeAlertAction() -> UIAlertAction { - let title = localizedNextTimeButtonTitle() - let action = UIAlertAction(title: title, style: .default) { [weak self] _ in - guard let self = self else { return } - - self.hideWindow() - self.delegate?.sirenUserDidCancel() - self.alertViewIsVisible = false - UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch = true - return + if rules.frequency == .immediately { + presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType) + } else if UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch { + UserDefaults.shouldPerformVersionCheckOnSubsequentLaunch = false + presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType) + } else { + guard let alertPresentationDate = alertPresentationDate else { + presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType) + return + } + if Date.days(since: alertPresentationDate) >= rules.frequency.rawValue { + presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType) + } else { + resultsHandler?(nil, .recentlyPrompted) + } } - - return action } - func skipAlertAction() -> UIAlertAction { - let title = localizedSkipButtonTitle() - let action = UIAlertAction(title: title, style: .default) { [weak self] _ in + /// Presents the update alert to the end user. + /// Upon tapping a value on the alert view, a completion handler will return all relevant metadata to the app. + /// + /// - Parameters: + /// - rules: The rules for how to present the alert. + /// - currentAppStoreVersion: The current version of the app in the App Store. + /// - model: The iTunes Lookup Model. + /// - updateType: The type of update that is available based on the version found in the App Store. + func presentAlert(withRules rules: Rules, + forCurrentAppStoreVersion currentAppStoreVersion: String, + model: LookupModel, + andUpdateType updateType: RulesManager.UpdateType) { + presentationManager.presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion) { [weak self] alertAction in guard let self = self else { return } - - if let currentAppStoreVersion = self.currentAppStoreVersion { - UserDefaults.storedSkippedVersion = currentAppStoreVersion - UserDefaults.standard.synchronize() - } - - self.hideWindow() - self.delegate?.sirenUserDidSkipVersion() - self.alertViewIsVisible = false - return + let results = Results(alertAction: alertAction, + localization: self.presentationManager.localization, + lookupModel: model, + updateType: updateType) + self.resultsHandler?(results, nil) } - - return action } - func setAlertType() -> Siren.AlertType { - guard let currentInstalledVersion = currentInstalledVersion, - let currentAppStoreVersion = currentAppStoreVersion else { - return .option - } - - let oldVersion = (currentInstalledVersion).lazy.split {$0 == "."}.map { String($0) }.map {Int($0) ?? 0} - let newVersion = (currentAppStoreVersion).lazy.split {$0 == "."}.map { String($0) }.map {Int($0) ?? 0} - - guard let newVersionFirst = newVersion.first, let oldVersionFirst = oldVersion.first else { - return alertType // Default value is .Option + /// Add an observer that listens for app launching/relaunching + /// (e.g., calls to `UIApplication`'s `didBecomeActive` function). + func addObservers() { + guard didBecomeActiveObserver == nil else { return } + didBecomeActiveObserver = NotificationCenter + .default + .addObserver(forName: UIApplication.didBecomeActiveNotification, + object: nil, + queue: nil) { [weak self] _ in + guard let self = self else { return } + self.performVersionCheck() } - - if newVersionFirst > oldVersionFirst { // A.b.c.d - alertType = majorUpdateAlertType - updateType = .major - } else if newVersion.count > 1 && (oldVersion.count <= 1 || newVersion[1] > oldVersion[1]) { // a.B.c.d - alertType = minorUpdateAlertType - updateType = .minor - } else if newVersion.count > 2 && (oldVersion.count <= 2 || newVersion[2] > oldVersion[2]) { // a.b.C.d - alertType = patchUpdateAlertType - updateType = .patch - } else if newVersion.count > 3 && (oldVersion.count <= 3 || newVersion[3] > oldVersion[3]) { // a.b.c.D - alertType = revisionUpdateAlertType - updateType = .revision - } - - return alertType } } diff --git a/Sources/Utilities/DataParser.swift b/Sources/Utilities/DataParser.swift new file mode 100644 index 00000000..849238da --- /dev/null +++ b/Sources/Utilities/DataParser.swift @@ -0,0 +1,92 @@ +// +// DataParser.swift +// Siren +// +// Created by Arthur Sabintsev on 11/25/18. +// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// Version parsing functions for Siren. +struct DataParser { + /// Checks to see if the App Store version of the app is newer than the installed version. + /// + /// - Parameters: + /// - installedVersion: The installed version of the app. + /// - appStoreVersion: The App Store version of the app. + /// - Returns: `true` if the App Store version is newer. Otherwise, `false`. + static func isAppStoreVersionNewer(installedVersion: String?, appStoreVersion: String?) -> Bool { + guard let installedVersion = installedVersion, + let appStoreVersion = appStoreVersion, + (installedVersion.compare(appStoreVersion, options: .numeric) == .orderedAscending) else { + return false + } + + return true + } + + /// Validates that the latest version in the App Store is compatible with the device's current version of iOS. + /// + /// - Parameter model: The iTunes Lookup Model. + /// - Returns: `true` if the latest version is compatible with the device's current version of iOS. Otherwise, `false`. + static func isUpdateCompatibleWithDeviceOS(for model: LookupModel) -> Bool { + guard let requiredOSVersion = model.results.first?.minimumOSVersion else { + return false + } + + let systemVersion = UIDevice.current.systemVersion + + guard systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedDescending || + systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedSame else { + return false + } + + return true + } + + /// The type of update that is returned from the API in relation to the verison of the app that is installed. + /// + /// - Parameters: + /// - installedVersion: The installed version of the app. + /// - appStoreVersion: The App Store version of the app. + /// - Returns: The type of update in relation to the verison of the app that is installed. + static func parseForUpdate(forInstalledVersion installedVersion: String?, + andAppStoreVersion appStoreVersion: String?) -> RulesManager.UpdateType { + guard let installedVersion = installedVersion, + let appStoreVersion = appStoreVersion else { + return .unknown + } + + let oldVersion = split(version: installedVersion) + let newVersion = split(version: appStoreVersion) + + guard let newVersionFirst = newVersion.first, + let oldVersionFirst = oldVersion.first else { + return .unknown + } + + if newVersionFirst > oldVersionFirst { // A.b.c.d + return .major + } else if newVersion.count > 1 && (oldVersion.count <= 1 || newVersion[1] > oldVersion[1]) { // a.B.c.d + return .minor + } else if newVersion.count > 2 && (oldVersion.count <= 2 || newVersion[2] > oldVersion[2]) { // a.b.C.d + return .patch + } else if newVersion.count > 3 && (oldVersion.count <= 3 || newVersion[3] > oldVersion[3]) { // a.b.c.D + return .revision + } else { + return .unknown + } + } + + /// Splits a version-formatted `String into an `[Int]`. + /// + /// Converts `"a.b.c.d"` into `[a, b, c, d]`. + /// + /// - Parameter version: The version formatted `String`. + /// + /// - Returns: An array of integers representing a version of the app. + private static func split(version: String) -> [Int] { + return version.lazy.split {$0 == "."}.map { String($0) }.map {Int($0) ?? 0} + } +} diff --git a/Sources/Utilities/KnownError.swift b/Sources/Utilities/KnownError.swift new file mode 100644 index 00000000..da1fce32 --- /dev/null +++ b/Sources/Utilities/KnownError.swift @@ -0,0 +1,78 @@ +// +// KnownError.swift +// Siren +// +// Created by Arthur Sabintsev on 8/6/17. +// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. +// + +import Foundation + +/// Enumerates all potentials errors that Siren can handle. +public enum KnownError: LocalizedError { + /// Error retrieving trackId as the JSON does not contain a 'trackId' key. + case appStoreAppIDFailure + /// Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error. + case appStoreDataRetrievalEmptyResults + /// Error retrieving App Store data as an error was returned. + case appStoreDataRetrievalFailure(underlyingError: Error?) + /// Error parsing App Store JSON data. + case appStoreJSONParsingFailure(underlyingError: Error) + /// The version of iOS on the device is lower than that of the one required by the app verison update. + case appStoreOSVersionUnsupported + /// Error retrieving App Store verson number as the JSON does not contain a `version` key. + case appStoreVersionArrayFailure + /// The `currentVersionReleaseDate` key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible. + case currentVersionReleaseDate + /// One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible. + case malformedURL + /// Please make sure that you have set a `Bundle Identifier` in your project. + case missingBundleID + /// No new update available. + case noUpdateAvailable + /// Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the `UpdatePromptFrequency.immediately` rule in `RulesManager` + case recentlyPrompted + /// The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed. + case releasedTooSoon(daysSinceRelease: Int, releasedForDays: Int) + /// The user has opted to skip updating their current version of the app to the current App Store version. + case skipVersionUpdate(installedVersion: String, appStoreVersion: String) + + /// The localized description for each error handled by Siren. + public var localizedDescription: String { + switch self { + case .appStoreAppIDFailure: + return "\(KnownError.sirenError) Error retrieving trackId as the JSON does not contain a `trackId` key." + case .appStoreDataRetrievalFailure(let error?): + return "\(KnownError.sirenError) Error retrieving App Store data as an error was returned\nAlso, the following system level error was returned: \(error)" + case .appStoreDataRetrievalEmptyResults: + return "\(KnownError.sirenError) Error retrieving App Store data as the JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error." + case .appStoreDataRetrievalFailure(.none): + return "\(KnownError.sirenError) Error retrieving App Store data as an error was returned." + case .appStoreJSONParsingFailure(let error): + return "\(KnownError.sirenError) Error parsing App Store JSON data.\nAlso, the following system level error was returned: \(error)" + case .appStoreOSVersionUnsupported: + return "\(KnownError.sirenError) The version of iOS on the device is lower than that of the one required by the app verison update." + case .appStoreVersionArrayFailure: + return "\(KnownError.sirenError) Error retrieving App Store verson number as the JSON does not contain a `version` key." + case .currentVersionReleaseDate: + return "\(KnownError.sirenError) The `currentVersionReleaseDate` key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible." + case .malformedURL: + return "\(KnownError.sirenError) One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible." + case .missingBundleID: + return "\(KnownError.sirenError) Please make sure that you have set a `Bundle Identifier` in your project." + case .noUpdateAvailable: + return "\(KnownError.sirenError) No new update available." + case .recentlyPrompted: + return "\(KnownError.sirenError) Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the `\(Rules.UpdatePromptFrequency.self).immediately` rule in `\(RulesManager.self)`" + case .releasedTooSoon(let daysSinceRelease, let releasedForDays): + return "\(KnownError.sirenError) The app has been released for \(daysSinceRelease) days, but Siren cannot prompt the user until \(releasedForDays) days have passed." + case .skipVersionUpdate(let installedVersion, let appStoreVersion): + return "\(KnownError.sirenError) The user has opted to skip updating their current version of the app (\(installedVersion)) to the current App Store version (\(appStoreVersion))." + } + } + + /// An easily identifiable prefix for all errors thrown by Siren. + private static var sirenError: String { + return "[Siren Error]" + } +} diff --git a/Sources/Utilities/SirenConstants.swift b/Sources/Utilities/SirenConstants.swift deleted file mode 100644 index 06b7803c..00000000 --- a/Sources/Utilities/SirenConstants.swift +++ /dev/null @@ -1,129 +0,0 @@ -// -// SirenConstants.swift -// Siren -// -// Created by Arthur Sabintsev on 9/25/18. -// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Enumerated Types - -// MARK: Siren extension dealing with enumerated types and constants. -public extension Siren { - /// Determines the type of alert to present after a successful version check has been performed. - enum AlertType { - /// Forces user to update your app (1 button alert). - case force - /// (DEFAULT) Presents user with option to update app now or at next launch (2 button alert). - case option - /// Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert). - case skip - /// Doesn't show the alert, but instead returns a localized message - /// for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method. - case none - } - - /// Determines the frequency in which the the version check is performed and the user is prompted to update the app. - /// - enum VersionCheckType: Int { - /// Version check performed every time the app is launched. - case immediately = 0 - /// Version check performed once a day. - case daily = 1 - /// Version check performed once a week. - case weekly = 7 - } - - /// Determines the available languages in which the update message and alert button titles should appear. - /// - /// By default, the operating system's default lanuage setting is used. However, you can force a specific language - /// by setting the forceLanguageLocalization property before calling checkVersion() - enum LanguageType: String { - /// Arabic - case arabic = "ar" - /// Armenian - case armenian = "hy" - /// Basque - case basque = "eu" - /// Simplified Chinese - case chineseSimplified = "zh-Hans" - /// Traditional Chinese - case chineseTraditional = "zh-Hant" - /// Croatian - case croatian = "hr" - /// Czech - case czech = "cs" - /// Danish - case danish = "da" - /// Dutch - case dutch = "nl" - /// English - case english = "en" - /// Estonian - case estonian = "et" - /// Finnish - case finnish = "fi" - /// French - case french = "fr" - /// German - case german = "de" - /// Greek - case greek = "el" - /// Hebrew - case hebrew = "he" - /// Hungarian - case hungarian = "hu" - /// Indonesian - case indonesian = "id" - /// Italian - case italian = "it" - /// Japanese - case japanese = "ja" - /// Korean - case korean = "ko" - /// Latvian - case latvian = "lv" - /// Lithuanian - case lithuanian = "lt" - /// Malaysian - case malay = "ms" - /// Norwegian - case norwegian = "nb-NO" - /// Persian - case persian = "fa" - /// Persian (Afghanistan) - case persianAfghanistan = "fa-AF" - /// Persian (Iran) - case persianIran = "fa-IR" - /// Polish - case polish = "pl" - /// Portuguese (Brazil) - case portugueseBrazil = "pt" - /// Portuguese (Portugal) - case portuguesePortugal = "pt-PT" - /// Russian - case russian = "ru" - /// Serbian (Cyrillic) - case serbianCyrillic = "sr-Cyrl" - /// Serbian (Latin) - case serbianLatin = "sr-Latn" - /// Slovenian - case slovenian = "sl" - /// Spanish - case spanish = "es" - /// Swedish - case swedish = "sv" - /// Thai - case thai = "th" - /// Turkish - case turkish = "tr" - /// Urdu - case urdu = "ur" - /// Ukranian - case ukrainian = "uk" - /// Vietnamese - case vietnamese = "vi" - } -} diff --git a/Sources/Utilities/SirenError.swift b/Sources/Utilities/SirenError.swift deleted file mode 100644 index 95b3d008..00000000 --- a/Sources/Utilities/SirenError.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// SirenError.swift -// Siren -// -// Created by Arthur Sabintsev on 8/6/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Siren Error Handling - -/// Data structure used to build Siren specific Errors. -public struct SirenError: LocalizedError { - /// Enumerates all potentials errors that Siren can handle. - /// - /// - appStoreAppIDFailure: Error retrieving trackId as the JSON does not contain a 'trackId' key. - /// - appStoreDataRetrievalFailure: Error retrieving App Store data as an error was returned. - /// - appStoreJSONParsingFailure: Error parsing App Store JSON data. - /// - appStoreDataRetrievalEmptyResults: Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error. - /// - appStoreOSVersionNumberFailure: Error retrieving iOS version number as there was no data returned. - /// - appStoreOSVersionUnsupported: The version of iOS on the device is lower than that of the one required by the app verison update. - /// - appStoreVersionArrayFailure: Error retrieving App Store verson number as the JSON does not contain a 'version' key. - /// - malformedURL: The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible. - /// - noUpdateAvailable: No new update available. - /// - recentlyCheckedAlready: Not checking the version, because it was already checked recently. - public enum Known: Error { - /// Error retrieving trackId as the JSON does not contain a 'trackId' key. - case appStoreAppIDFailure - /// Error retrieving App Store data as an error was returned. - case appStoreDataRetrievalFailure(underlyingError: Error?) - /// Error parsing App Store JSON data. - case appStoreJSONParsingFailure(underlyingError: Error) - /// Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error. - case appStoreDataRetrievalEmptyResults - /// Error retrieving iOS version number as there was no data returned. - case appStoreOSVersionNumberFailure - /// The version of iOS on the device is lower than that of the one required by the app verison update. - case appStoreOSVersionUnsupported - /// Error retrieving App Store verson number as the JSON does not contain a 'version' key. - case appStoreVersionArrayFailure - /// The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible. - case malformedURL - /// No new update available. - case noUpdateAvailable - /// Not checking the version, because it was already checked recently. - case recentlyCheckedAlready - - /// The localized description for each error handled by Siren. - var localizedDescription: String { - switch self { - case .appStoreAppIDFailure: - return "Error retrieving trackId as the JSON does not contain a 'trackId' key." - case .appStoreDataRetrievalFailure(let error?): - return "Error retrieving App Store data as an error was returned\nAlso, the following system level error was returned: \(error)" - case .appStoreDataRetrievalFailure(.none): - return "Error retrieving App Store data as an error was returned." - case .appStoreDataRetrievalEmptyResults: - return "Error retrieving App Store data as the JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error." - case .appStoreJSONParsingFailure(let error): - return "Error parsing App Store JSON data.\nAlso, the following system level error was returned: \(error)" - case .appStoreOSVersionNumberFailure: - return "Error retrieving iOS version number as there was no data returned." - case .appStoreOSVersionUnsupported: - return "The version of iOS on the device is lower than that of the one required by the app verison update." - case .appStoreVersionArrayFailure: - return "Error retrieving App Store verson number as the JSON does not contain a 'version' key." - case .malformedURL: - return "The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible." - case .noUpdateAvailable: - return "No new update available." - case .recentlyCheckedAlready: - return "Not checking the version, because it was already checked recently." - } - } - } -} - -// MARK: - Error Handling - -extension Siren { - func postError(_ error: SirenError.Known) { - delegate?.sirenDidFailVersionCheck(error: error) - printMessage(error.localizedDescription) - } -} diff --git a/Sources/Utilities/SirenHelpers.swift b/Sources/Utilities/SirenHelpers.swift deleted file mode 100644 index 112e43fa..00000000 --- a/Sources/Utilities/SirenHelpers.swift +++ /dev/null @@ -1,83 +0,0 @@ -// -// SirenHelpers.swift -// Siren -// -// Created by Arthur Sabintsev on 9/25/18. -// Copyright © 2018 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Version - -extension Siren { - func isAppStoreVersionNewer() -> Bool { - var newVersionExists = false - - if let currentInstalledVersion = currentInstalledVersion, - let currentAppStoreVersion = currentAppStoreVersion, - (currentInstalledVersion.compare(currentAppStoreVersion, options: .numeric) == .orderedAscending) { - - newVersionExists = true - } - - return newVersionExists - } - - func storeVersionCheckDate() { - lastVersionCheckPerformedOnDate = Date() - if let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate { - UserDefaults.storedVersionCheckDate = lastVersionCheckPerformedOnDate - UserDefaults.standard.synchronize() - } - } -} - -// MARK: - Miscellaneous - -extension Siren { - func isUpdateCompatibleWithDeviceOS(for model: SirenLookupModel) -> Bool { - guard let requiredOSVersion = model.results.first?.minimumOSVersion else { - postError(.appStoreOSVersionNumberFailure) - return false - } - - let systemVersion = UIDevice.current.systemVersion - - guard systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedDescending || - systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedSame else { - postError(.appStoreOSVersionUnsupported) - return false - } - - return true - } - - func hideWindow() { - if let updaterWindow = updaterWindow { - updaterWindow.isHidden = true - self.updaterWindow = nil - } - } - - /// Routes a console-bound message to the `SirenLog` struct, which decorates the log message. - /// - /// - Parameter message: The message to decorate and log to the console. - func printMessage(_ message: String) { - if debugEnabled { - SirenLog(message) - } - } -} - -// MARK: - Test Target - -extension Siren { - func testSetCurrentInstalledVersion(version: String) { - currentInstalledVersion = version - } - - func testSetAppStoreVersion(version: String) { - currentAppStoreVersion = version - } -} diff --git a/Sources/Utilities/SirenLog.swift b/Sources/Utilities/SirenLog.swift deleted file mode 100644 index a64d45bf..00000000 --- a/Sources/Utilities/SirenLog.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SirenLog.swift -// SirenExample -// -// Created by Arthur Sabintsev on 8/5/17. -// Copyright © 2017 Sabintsev iOS Projects. All rights reserved. -// - -import Foundation - -// MARK: - Log and decorate Siren-specific messages to the console. - -struct SirenLog { - @discardableResult - init(_ message: String) { - print("[Siren] \(message)") - } -} diff --git a/Sources/View Controllers/SirenViewController.swift b/Sources/View Controllers/SirenViewController.swift index b9712d13..a0a47dd3 100644 --- a/Sources/View Controllers/SirenViewController.swift +++ b/Sources/View Controllers/SirenViewController.swift @@ -1,6 +1,6 @@ // // SirenViewController.swift -// SirenExample +// Siren // // Created by Arthur Sabintsev on 3/17/17. // Copyright © 2017 Sabintsev iOS Projects. All rights reserved. @@ -9,8 +9,10 @@ import Foundation import UIKit -// MARK: - UIViewController Extension for Siren - +/// `UIViewController` Extension for Siren final class SirenViewController: UIViewController { - override var preferredStatusBarStyle: UIStatusBarStyle { return UIApplication.shared.statusBarStyle } + /// `UIStatusBarStyle` override. + override var preferredStatusBarStyle: UIStatusBarStyle { + return UIApplication.shared.statusBarStyle + } } diff --git a/docs/Classes.html b/docs/Classes.html index 48c529f0..6dd105a4 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -34,13 +34,7 @@ Siren - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -94,13 +136,6 @@

Classes

-
- - - -

Siren

-
-
  • @@ -115,7 +150,7 @@

    Siren

    -

    The Siren Class. A singleton that is initialized using the shared constant.

    +

    The Siren Class.

    See more
    @@ -132,10 +167,42 @@

    Declaration

+
+
    +
  • +
    + + + + SirenViewController + +
    +
    +
    +
    +
    +
    +

    UIViewController Extension for Siren

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    final class SirenViewController : UIViewController
    + +
    +
    +
    +
    +
  • +
+
diff --git a/docs/Classes/Siren.html b/docs/Classes/Siren.html index 66663cda..8441ed14 100644 --- a/docs/Classes/Siren.html +++ b/docs/Classes/Siren.html @@ -34,13 +34,7 @@ Siren - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -95,7 +137,7 @@

Siren

-

The Siren Class. A singleton that is initialized using the shared constant.

+

The Siren Class.

@@ -104,9 +146,9 @@

Siren

  • @@ -114,14 +156,14 @@

    Siren

    -

    The error domain for all errors created by Siren.

    +

    Return results or errors obtained from performing a version check with Siren.

    Declaration

    Swift

    -
    public let SirenErrorDomain: String
    +
    public typealias ResultsHandler = (Results?, KnownError?) -> Void
    @@ -131,9 +173,9 @@

    Declaration

  • - - - delegate + + + shared
    @@ -141,15 +183,14 @@

    Declaration

    -

    The SirenDelegate variable, which should be set if you’d like to be notified of any of specific user interactions or API success/failures. -Also set this variable if you’d like to use custom UI for presesnting the update notification.

    +

    The Siren singleton. The main point of entry to the Siren library.

    Declaration

    Swift

    -
    public weak var delegate: SirenDelegate?
    +
    public static let shared: Siren
    @@ -170,7 +211,7 @@

    Declaration

    The debug flag, which is disabled by default. -When enabled, a stream of print() statements are logged to your console when a version check is performed.

    +When enabled, a stream of print() statements are logged to your console when a version check is performed.

    @@ -187,9 +228,9 @@

    Declaration

  • - - - alertType + + + apiManager
    @@ -197,44 +238,17 @@

    Declaration

    -

    Determines the type of alert that should be shown. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the App Store API that is +used to fetch the latest version of the app.

    -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var alertType: Siren.AlertType { get set }
    - -
    -
    -
    -
    -
  • -
  • -
    - - - - majorUpdateAlertType - -
    -
    -
    -
    -
    -
    -

    Determines the type of alert that should be shown for major version updates: A.b.c -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    Defaults to the US App Store.

    Declaration

    Swift

    -
    public lazy var majorUpdateAlertType: AlertType { get set }
    +
    public lazy var apiManager: APIManager { get set }
    @@ -244,9 +258,9 @@

    Declaration

  • @@ -254,16 +268,16 @@

    Declaration

    -

    Determines the type of alert that should be shown for minor version updates: a.B.c -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the update alert’s string localization and tint color.

    + +

    Defaults the string’s lange localization to the user’s device localization.

    Declaration

    Swift

    -
    public lazy var minorUpdateAlertType: AlertType { get set }
    +
    public lazy var presentationManager: PresentationManager { get set }
    @@ -273,9 +287,9 @@

    Declaration

  • @@ -283,16 +297,21 @@

    Declaration

    -

    Determines the type of alert that should be shown for minor patch updates: a.b.C -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the type of alert that should be displayed +and how often an alert should be displayed dpeneding on the type +of update that is available relative to the installed version of the app +(e.g., different rules for major, minor, patch and revision updated can be used).

    + +

    Defaults to performing a version check once a day with an alert that allows +the user to skip updating the app until the next time the app becomes active or +skipping the update all together until another version is released.

    Declaration

    Swift

    -
    public lazy var patchUpdateAlertType: AlertType { get set }
    +
    public lazy var rulesManager: RulesManager { get set }
    @@ -302,9 +321,9 @@

    Declaration

  • @@ -312,16 +331,14 @@

    Declaration

    -

    Determines the type of alert that should be shown for revision updates: a.b.c.D -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The current installed version of your app.

    Declaration

    Swift

    -
    public lazy var revisionUpdateAlertType: AlertType { get set }
    +
    lazy var currentInstalledVersion: String? { get set }
    @@ -331,9 +348,9 @@

    Declaration

  • @@ -341,15 +358,14 @@

    Declaration

    -

    The name of your app. -By default, it’s set to the name of the app that’s stored in your plist.

    +

    The retained NotificationCenter observer that listens for UIApplication.didBecomeActiveNotification notifications.

    Declaration

    Swift

    -
    public lazy var appName: String { get set }
    +
    var didBecomeActiveObserver: NSObjectProtocol?
    @@ -359,9 +375,9 @@

    Declaration

  • @@ -369,15 +385,14 @@

    Declaration

    -

    Overrides all the Strings to which Siren defaults. -Defaults to the values defined in SirenAlertMessaging.Constants

    +

    The last date that an alert was presented to the user.

    Declaration

    Swift

    -
    public var alertMessaging: SirenAlertMessaging
    +
    private var alertPresentationDate: Date?
    @@ -387,9 +402,9 @@

    Declaration

  • - - - countryCode + + + appID
    @@ -397,16 +412,14 @@

    Declaration

    -

    The region or country of an App Store in which your app is available. -By default, all version checks are performed against the US App Store. -If your app is not available in the US App Store, set it to the identifier of at least one App Store within which it is available.

    +

    The App Store’s unique identifier for an app.

    Declaration

    Swift

    -
    public var countryCode: String?
    +
    private var appID: Int?
    @@ -416,9 +429,9 @@

    Declaration

  • @@ -426,15 +439,14 @@

    Declaration

    -

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert. -See the Siren.LanguageType enum for more details.

    +

    The completion handler used to return the results or errors returned by Siren.

    Declaration

    Swift

    -
    public var forceLanguageLocalization: Siren.LanguageType?
    +
    private var resultsHandler: Siren.ResultsHandler?
    @@ -444,9 +456,9 @@

    Declaration

  • @@ -454,26 +466,37 @@

    Declaration

    -

    Overrides the tint color for UIAlertController.

    +

    The initialization method.

    Declaration

    Swift

    -
    public var alertControllerTintColor: UIColor?
    +
    private override init()
  • + +
    +
    + +
    • @@ -481,27 +504,44 @@

      Declaration

      -

      When this is set, the alert will only show up if the current version has already been released for X days. -Defaults to 1 day to avoid an issue where Apple updates the JSON faster than the app binary propogates to the App Store.

      - +

      Declaration

      Swift

      -
      public var showAlertAfterCurrentVersionHasBeenReleasedForDays: Int
      +
      func wail(completion handler: ResultsHandler? = nil)
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      +
      +
      +
    • @@ -509,26 +549,40 @@

      Declaration

      -

      The current version of your app that is available for download on the App Store

      +

      Launches the AppStore in two situations when the user clicked the Update button in the UIAlertController modal.

      + +

      This function is marked public as a convenience for those developers who decide to build a custom alert modal +instead of using Siren’s prebuilt update alert.

      Declaration

      Swift

      -
      public internal(set) var currentAppStoreVersion: String?
      +
      func launchAppStore()
    • +
    +
    +
    + +
    • @@ -536,14 +590,14 @@

      Declaration

      -

      The App’s Singleton

      +

      Initiates the uni-directional version checking flow.

      Declaration

      Swift

      -
      public static let shared: Siren
      +
      func performVersionCheck()
      @@ -553,9 +607,9 @@

      Declaration

    • @@ -563,16 +617,16 @@

      Declaration

      -

      Checks the currently installed version of your app against the App Store. -The default check is against the US App Store, but if your app is not listed in the US, -you should set the countryCode property before calling this method. Please refer to the countryCode property for more information.

      +

      Validates the parsed and mapped iTunes Lookup Model +to guarantee all the relevant data was returned before +attempting to present an alert.

      Declaration

      Swift

      -
      public func checkVersion(checkType: VersionCheckType)
      +
      func validate(model: LookupModel)
      @@ -583,12 +637,12 @@

      Parameters

      - checkType + model
      -

      The frequency in days in which you want a check to be performed. Please refer to the Siren.VersionCheckType enum for more details.

      +

      The iTunes Lookup Model.

      @@ -601,9 +655,9 @@

      Parameters

    • @@ -611,60 +665,48 @@

      Parameters

      -

      Launches the AppStore in two situations:

      - -
        -
      • User clicked the Update button in the UIAlertController modal.
      • -
      • Developer built a custom alert modal and needs to be able to call this function when the user chooses to update the app in the aforementioned custom modal.
      • -
      +

      Determines if the update alert can be presented based on the +rules set in the RulesManager and the the skip version settings.

      Declaration

      Swift

      -
      public func launchAppStore()
      +
      func determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion currentAppStoreVersion: String, andLookupModel model: LookupModel)
      -
      -
      -
    • -
    -
    -
    - -
      -
    • -
      - - - - AlertType - -
      -
      -
      -
      -
      -
      -

      Determines the type of alert to present after a successful version check has been performed.

      - - See more -
      -
      -

      Declaration

      -
      -

      Swift

      -
      enum AlertType
      - -
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + currentAppStoreVersion + + +
      +

      The curren version of the app in the App Store.

      +
      +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      @@ -672,9 +714,9 @@

      Declaration

    • @@ -682,27 +724,85 @@

      Declaration

      -

      Determines the frequency in which the the version check is performed and the user is prompted to update the app.

      +

      Presents the update alert to the end user. +Upon tapping a value on the alert view, a completion handler will return all relevant metadata to the app.

      - See more

      Declaration

      Swift

      -
      enum VersionCheckType : Int
      +
      func presentAlert(withRules rules: Rules,
      +                  forCurrentAppStoreVersion currentAppStoreVersion: String,
      +                  model: LookupModel,
      +                  andUpdateType updateType: RulesManager.UpdateType)
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + rules + + +
      +

      The rules for how to present the alert.

      +
      +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      + + updateType + + +
      +

      The type of update that is available based on the version found in the App Store.

      +
      +
      +
    • @@ -710,18 +810,15 @@

      Declaration

      -

      Determines the available languages in which the update message and alert button titles should appear.

      - -

      By default, the operating system’s default lanuage setting is used. However, you can force a specific language -by setting the forceLanguageLocalization property before calling checkVersion()

      +

      Add an observer that listens for app launching/relaunching +(e.g., calls to UIApplication‘s didBecomeActive function).

      - See more

      Declaration

      Swift

      -
      enum LanguageType : String
      +
      func addObservers()
      @@ -733,7 +830,7 @@

      Declaration

  • diff --git a/docs/Classes/Siren/AlertType.html b/docs/Classes/Siren/AlertType.html index 414365b5..dac6a08f 100644 --- a/docs/Classes/Siren/AlertType.html +++ b/docs/Classes/Siren/AlertType.html @@ -64,22 +64,22 @@ Structures
  • @@ -104,9 +104,9 @@

    AlertType

  • - + - force + force
    @@ -131,9 +131,9 @@

    Declaration

  • - + - option + option
    @@ -158,9 +158,9 @@

    Declaration

  • - + - skip + skip
    @@ -185,9 +185,9 @@

    Declaration

  • - + - none + none
    @@ -215,7 +215,7 @@

    Declaration

  • diff --git a/docs/Classes/Siren/LanguageType.html b/docs/Classes/Siren/LanguageType.html index 0802a3cd..1c849a98 100644 --- a/docs/Classes/Siren/LanguageType.html +++ b/docs/Classes/Siren/LanguageType.html @@ -64,22 +64,22 @@ Structures
  • @@ -107,9 +107,9 @@

    LanguageType

  • - + - arabic + arabic
    @@ -134,9 +134,9 @@

    Declaration

  • - + - armenian + armenian
    @@ -161,9 +161,9 @@

    Declaration

  • - + - basque + basque
    @@ -188,9 +188,9 @@

    Declaration

  • @@ -215,9 +215,9 @@

    Declaration

  • @@ -242,9 +242,9 @@

    Declaration

  • - + - croatian + croatian
    @@ -269,9 +269,9 @@

    Declaration

  • - + - czech + czech
    @@ -296,9 +296,9 @@

    Declaration

  • - + - danish + danish
    @@ -323,9 +323,9 @@

    Declaration

  • - + - dutch + dutch
    @@ -350,9 +350,9 @@

    Declaration

  • - + - english + english
    @@ -377,9 +377,9 @@

    Declaration

  • - + - estonian + estonian
    @@ -404,9 +404,9 @@

    Declaration

  • - + - finnish + finnish
    @@ -431,9 +431,9 @@

    Declaration

  • - + - french + french
    @@ -458,9 +458,9 @@

    Declaration

  • - + - german + german
    @@ -485,9 +485,9 @@

    Declaration

  • - + - greek + greek
    @@ -512,9 +512,9 @@

    Declaration

  • - + - hebrew + hebrew
    @@ -539,9 +539,9 @@

    Declaration

  • @@ -566,9 +566,9 @@

    Declaration

  • @@ -593,9 +593,9 @@

    Declaration

  • - + - italian + italian
    @@ -620,9 +620,9 @@

    Declaration

  • - + - japanese + japanese
    @@ -647,9 +647,9 @@

    Declaration

  • - + - korean + korean
    @@ -674,9 +674,9 @@

    Declaration

  • - + - latvian + latvian
    @@ -701,9 +701,9 @@

    Declaration

  • @@ -728,9 +728,9 @@

    Declaration

  • - + - malay + malay
    @@ -755,9 +755,9 @@

    Declaration

  • @@ -782,9 +782,9 @@

    Declaration

  • - + - persian + persian
    @@ -809,9 +809,9 @@

    Declaration

  • @@ -836,9 +836,9 @@

    Declaration

  • @@ -863,9 +863,9 @@

    Declaration

  • - + - polish + polish
    @@ -890,9 +890,9 @@

    Declaration

  • @@ -917,9 +917,9 @@

    Declaration

  • @@ -944,9 +944,9 @@

    Declaration

  • - + - russian + russian
    @@ -971,9 +971,9 @@

    Declaration

  • @@ -998,9 +998,9 @@

    Declaration

  • @@ -1025,9 +1025,9 @@

    Declaration

  • @@ -1052,9 +1052,9 @@

    Declaration

  • - + - spanish + spanish
    @@ -1079,9 +1079,9 @@

    Declaration

  • - + - swedish + swedish
    @@ -1106,9 +1106,9 @@

    Declaration

  • - + - thai + thai
    @@ -1133,9 +1133,9 @@

    Declaration

  • - + - turkish + turkish
    @@ -1160,9 +1160,9 @@

    Declaration

  • - + - urdu + urdu
    @@ -1187,9 +1187,9 @@

    Declaration

  • @@ -1214,9 +1214,9 @@

    Declaration

  • @@ -1243,7 +1243,7 @@

    Declaration

  • diff --git a/docs/Classes/Siren/VersionCheckType.html b/docs/Classes/Siren/VersionCheckType.html index 5a289556..548a463d 100644 --- a/docs/Classes/Siren/VersionCheckType.html +++ b/docs/Classes/Siren/VersionCheckType.html @@ -64,22 +64,22 @@ Structures
  • @@ -104,9 +104,9 @@

    VersionCheckType

  • @@ -131,9 +131,9 @@

    Declaration

  • - + - daily + daily
    @@ -158,9 +158,9 @@

    Declaration

  • - + - weekly + weekly
    @@ -187,7 +187,7 @@

    Declaration

  • diff --git a/docs/Classes/SirenViewController.html b/docs/Classes/SirenViewController.html new file mode 100644 index 00000000..543f954f --- /dev/null +++ b/docs/Classes/SirenViewController.html @@ -0,0 +1,185 @@ + + + + SirenViewController Class Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    SirenViewController

    +
    +
    +
    final class SirenViewController : UIViewController
    + +
    +
    +

    UIViewController Extension for Siren

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      UIStatusBarStyle override.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      override var preferredStatusBarStyle: UIStatusBarStyle { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/docs/Enums.html b/docs/Enums.html index bcf77e18..5e6c536b 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -34,13 +34,7 @@ Siren
  • - -
  • @@ -48,15 +42,33 @@ Enumerations
  • @@ -64,22 +76,52 @@ Structures @@ -98,9 +140,9 @@

    Enumerations

  • - - - UpdateType + + + AlertAction
    @@ -108,26 +150,47 @@

    Enumerations

    -

    MARK - Siren UpdateType -UpdateType defines what kind of update is available. -It is used as parameter if user wants to use -custom alert to inform the user about an update.

    +

    The UIAlertController button that was pressed upon being presented an update alert.

    -
      -
    • major: Major release available: A.b.c.d
    • -
    • minor: Minor release available: a.B.c.d
    • -
    • patch: Patch release available: a.b.C.d
    • -
    • revision: Revision release available: a.b.c.D
    • -
    • unknown: No information available about the update.
    • -
    + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum AlertAction
    + +
    +
    +
    +
    +
  • + + +
    +
      +
    • +
      + + + + KnownError + +
      +
      +
      +
      +
      +
      +

      Enumerates all potentials errors that Siren can handle.

      - See more + See more

      Declaration

      Swift

      -
      public enum UpdateType : String
      +
      public enum KnownError : LocalizedError
      @@ -139,7 +202,7 @@

      Declaration

    diff --git a/docs/Enums/AlertAction.html b/docs/Enums/AlertAction.html new file mode 100644 index 00000000..df23cf7a --- /dev/null +++ b/docs/Enums/AlertAction.html @@ -0,0 +1,266 @@ + + + + AlertAction Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertAction

    +
    +
    +
    public enum AlertAction
    + +
    +
    +

    The UIAlertController button that was pressed upon being presented an update alert.

    + +
    +
    +
    +
      +
    • +
      + + + + appStore + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Update option, which took them to the app’s App Store page.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStore
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTime + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Next Time option, which dismissed the alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case nextTime
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Skip this version option, which dismissed the alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      (Default) The user never chose an option. This is returned when an error is thrown by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Enums/KnownError.html b/docs/Enums/KnownError.html new file mode 100644 index 00000000..e60c3168 --- /dev/null +++ b/docs/Enums/KnownError.html @@ -0,0 +1,563 @@ + + + + KnownError Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    KnownError

    +
    +
    +
    public enum KnownError : LocalizedError
    + +
    +
    +

    Enumerates all potentials errors that Siren can handle.

    + +
    +
    +
    +
      +
    • +
      + + + + appStoreAppIDFailure + +
      +
      +
      +
      +
      +
      +

      Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreAppIDFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalEmptyResults
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as an error was returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalFailure(underlyingError: Error?)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error parsing App Store JSON data.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreJSONParsingFailure(underlyingError: Error)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The version of iOS on the device is lower than that of the one required by the app verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionUnsupported
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store verson number as the JSON does not contain a version key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreVersionArrayFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The currentVersionReleaseDate key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case currentVersionReleaseDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malformedURL + +
      +
      +
      +
      +
      +
      +

      One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malformedURL
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + missingBundleID + +
      +
      +
      +
      +
      +
      +

      Please make sure that you have set a Bundle Identifier in your project.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case missingBundleID
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + noUpdateAvailable + +
      +
      +
      +
      +
      +
      +

      No new update available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case noUpdateAvailable
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + recentlyPrompted + +
      +
      +
      +
      +
      +
      +

      Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the UpdatePromptFrequency.immediately rule in RulesManager

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case recentlyPrompted
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case releasedTooSoon(daysSinceRelease: Int, releasedForDays: Int)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The user has opted to skip updating their current version of the app to the current App Store version.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skipVersionUpdate(installedVersion: String, appStoreVersion: String)
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localizedDescription + +
      +
      +
      +
      +
      +
      +

      The localized description for each error handled by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var localizedDescription: String { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + sirenError + +
      +
      +
      +
      +
      +
      +

      An easily identifiable prefix for all errors thrown by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private static var sirenError: String { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Enums/UpdateType.html b/docs/Enums/UpdateType.html index 3a7b62d6..194d915c 100644 --- a/docs/Enums/UpdateType.html +++ b/docs/Enums/UpdateType.html @@ -64,22 +64,22 @@ Structures @@ -115,9 +115,9 @@

    UpdateType

  • - + - major + major
    @@ -142,9 +142,9 @@

    Declaration

  • - + - minor + minor
    @@ -169,9 +169,9 @@

    Declaration

  • - + - patch + patch
    @@ -196,9 +196,9 @@

    Declaration

  • - + - revision + revision
    @@ -223,9 +223,9 @@

    Declaration

  • - + - unknown + unknown
    @@ -252,7 +252,7 @@

    Declaration

    diff --git a/docs/Extensions.html b/docs/Extensions.html new file mode 100644 index 00000000..b3f816c0 --- /dev/null +++ b/docs/Extensions.html @@ -0,0 +1,272 @@ + + + + Extensions Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Extensions

    +

    The following extensions are available globally.

    + +
    +
    +
    +
      +
    • +
      + + + + Bundle + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class Bundle : NSObject
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Date + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      struct Date : ReferenceConvertible, Comparable, Equatable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + UIAlertController + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class UIAlertController : UIViewController
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + UserDefaults + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class UserDefaults : NSObject
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/docs/Extensions/Bundle.html b/docs/Extensions/Bundle.html new file mode 100644 index 00000000..a200bd70 --- /dev/null +++ b/docs/Extensions/Bundle.html @@ -0,0 +1,433 @@ + + + + Bundle Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Bundle

    +
    +
    +
    class Bundle : NSObject
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      Constants used in the Bundle extension.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      struct Constants
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version() + +
      +
      +
      +
      +
      +
      +

      Fetches the current verison of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func version() -> String?
      + +
      +
      +
      +

      Return Value

      +

      The current installed version of the app.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Returns the localized string for a given default string.

      + +

      By default, the English language localization is used. +If the device’s localization is set to another locale, that local’s language is used if it’s supported by Siren. +If forcedLanguage is set to true, the chosen language is shown for all devices, irrespective of their device’s localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func localizedString(forKey key: String, andForceLocalization forcedLanguage: Localization.Language?) -> String
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + key + + +
      +

      The default string used to search the localization table for a specific translation.

      +
      +
      + + forcedLanguage + + +
      +

      Returns

      +
      +
      +
      +
      +

      Return Value

      +

      The localized string for a given key.

      +
      +
      +
      +
    • +
    • +
      + + + + bestMatchingAppName() + +
      +
      +
      +
      +
      +
      +

      The appropriate name for the app to be displayed in the update alert.

      + +

      Siren checks CFBundleDisplayName first. It then falls back to +to kCFBundleNameKey and ultimately to an empty string +if the aforementioned values are nil.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func bestMatchingAppName() -> String
      + +
      +
      +
      +

      Return Value

      +

      The name of the app.

      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + sirenBundlePath() + +
      +
      +
      +
      +
      +
      +

      The path to Siren’s localization Bundle.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func sirenBundlePath() -> String?
      + +
      +
      +
      +

      Return Value

      +

      The bundle’s path or nil.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The path for a particular language localizationin Siren’s localization Bundle.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func sirenForcedBundlePath(forceLanguageLocalization: Localization.Language) -> String?
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + forceLanguageLocalization + + +
      +

      The language localization that should be searched for in Siren’s localization bundle.

      +
      +
      +
      +
      +

      Return Value

      +

      The path to the forced language localization.

      +
      +
      +
      +
    • +
    • +
      + + + + deviceLanguage() + +
      +
      +
      +
      +
      +
      +

      The user’s preferred language based on their device’s localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func deviceLanguage() -> Localization.Language?
      + +
      +
      +
      +

      Return Value

      +

      The user’s preferred language.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/Bundle/Constants.html b/docs/Extensions/Bundle/Constants.html new file mode 100644 index 00000000..744910b9 --- /dev/null +++ b/docs/Extensions/Bundle/Constants.html @@ -0,0 +1,320 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    struct Constants
    + +
    +
    +

    Constants used in the Bundle extension.

    + +
    +
    +
    +
      +
    • +
      + + + + bundleExtension + +
      +
      +
      +
      +
      +
      +

      Constant for the .bundle file extension.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let bundleExtension: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + displayName + +
      +
      +
      +
      +
      +
      +

      Constant for CFBundleDisplayName.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let displayName: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + englishLocalization + +
      +
      +
      +
      +
      +
      +

      Constant for the default US English localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let englishLocalization: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + projectExtension + +
      +
      +
      +
      +
      +
      +

      Constant for the project file extension.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let projectExtension: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + shortVersionString + +
      +
      +
      +
      +
      +
      +

      Constant for CFBundleShortVersionString.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let shortVersionString: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + table + +
      +
      +
      +
      +
      +
      +

      Constant for the localization table.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let table: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/Date.html b/docs/Extensions/Date.html new file mode 100644 index 00000000..c827524a --- /dev/null +++ b/docs/Extensions/Date.html @@ -0,0 +1,257 @@ + + + + Date Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Date

    +
    +
    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + days(since:) + +
      +
      +
      +
      +
      +
      +

      The amount of days passed from a specific source date.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func days(since date: Date) -> Int
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + date + + +
      +

      The source date.

      +
      +
      +
      +
      +

      Return Value

      +

      The amount of days passed since the source date.

      +
      +
      +
      +
    • +
    • +
      + + + + days(since:) + +
      +
      +
      +
      +
      +
      +

      The amount of days passed from a specific source date string.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func days(since dateString: String) -> Int?
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + dateString + + +
      +

      The source date string.

      +
      +
      +
      +
      +

      Return Value

      +

      The amount of days passed since the source date.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/UIAlertController.html b/docs/Extensions/UIAlertController.html new file mode 100644 index 00000000..41651dd0 --- /dev/null +++ b/docs/Extensions/UIAlertController.html @@ -0,0 +1,249 @@ + + + + UIAlertController Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UIAlertController

    +
    +
    +
    class UIAlertController : UIViewController
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + show(window:) + +
      +
      +
      +
      +
      +
      +

      Presents Siren’s UIAlertController in a new UIWindow.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func show(window: UIWindow)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + window + + +
      +

      The UIWindow that should reference Siren’s UIAlertController.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + hide(window:) + +
      +
      +
      +
      +
      +
      +

      Hides Siren’s UIAlertController within a given window.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func hide(window: UIWindow)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + window + + +
      +

      The UIWindow that references Siren’s UIAlertController.

      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/UserDefaults.html b/docs/Extensions/UserDefaults.html new file mode 100644 index 00000000..1c64d3cd --- /dev/null +++ b/docs/Extensions/UserDefaults.html @@ -0,0 +1,266 @@ + + + + UserDefaults Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UserDefaults

    +
    +
    +
    class UserDefaults : NSObject
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + SirenKeys + +
      +
      +
      +
      +
      +
      +

      Siren-specific UserDefaults Keys

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum SirenKeys : String
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around performing a version check on a subsequent launch.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var shouldPerformVersionCheckOnSubsequentLaunch: Bool { get set }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + storedSkippedVersion + +
      +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around storing a version that the user wants to skip updating.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var storedSkippedVersion: String? { get set }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertPresentationDate + +
      +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around the last time the user was presented a version update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var alertPresentationDate: Date? { get set }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Extensions/UserDefaults/SirenKeys.html b/docs/Extensions/UserDefaults/SirenKeys.html new file mode 100644 index 00000000..6983054f --- /dev/null +++ b/docs/Extensions/UserDefaults/SirenKeys.html @@ -0,0 +1,240 @@ + + + + SirenKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    SirenKeys

    +
    +
    +
    private enum SirenKeys : String
    + +
    +
    +

    Siren-specific UserDefaults Keys

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Key that notifies Siren to perform a version check and present +the Siren alert the next time the user launches the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case PerformVersionCheckOnSubsequentLaunch
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Key that stores the timestamp of the last version check.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case StoredVersionCheckDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + StoredSkippedVersion + +
      +
      +
      +
      +
      +
      +

      Key that stores the version that a user decided to skip.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case StoredSkippedVersion
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Protocols.html b/docs/Protocols.html index ccb40a40..17d6198c 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -33,23 +33,6 @@
  • - - - - - - @@ -135,7 +136,7 @@

    Declaration

    diff --git a/docs/Protocols/SirenDelegate.html b/docs/Protocols/SirenDelegate.html index edf9991e..59df3c7a 100644 --- a/docs/Protocols/SirenDelegate.html +++ b/docs/Protocols/SirenDelegate.html @@ -33,23 +33,6 @@ - - - - - - @@ -104,9 +105,9 @@

    SirenDelegate

  • - + - sirenDidDetectNewVersionWithoutAlert(title:message:updateType:) + sirenDidDetectNewVersionWithoutAlert(title:message:updateType:) Default implementation @@ -128,7 +129,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType)
    +
    func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: Constants.UpdateType)
    @@ -138,9 +139,9 @@

    Declaration

  • - + - sirenDidFailVersionCheck(error:) + sirenDidFailVersionCheck(error:) Default implementation @@ -178,9 +179,9 @@

    Declaration

  • - + - sirenDidShowUpdateDialog(alertType:) + sirenDidShowUpdateDialog(alertType:) Default implementation @@ -202,7 +203,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenDidShowUpdateDialog(alertType: Siren.AlertType)
    +
    func sirenDidShowUpdateDialog(alertType: Constants.AlertType)
    @@ -265,9 +266,9 @@

    Declaration

  • - + - sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:) + sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:) Default implementation @@ -289,7 +290,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel)
    +
    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: LookupModel)
    @@ -422,7 +423,7 @@

    Declaration

    diff --git a/docs/Structs.html b/docs/Structs.html index e8b05e98..c0ef5159 100644 --- a/docs/Structs.html +++ b/docs/Structs.html @@ -34,13 +34,7 @@ Siren
  • - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -94,20 +136,13 @@

    Structures

    -
    • @@ -115,22 +150,207 @@

      Siren Alert Messaging Customization

      -

      Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

      -
      -

      Warning

      - Overriding any of these keys will result in the loss of the built-in internationalization that Siren provides. +

      APIManager for Siren

      -
      + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct APIManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + PresentationManager + +
      +
      +
      +
      +
      +
      +

      PresentationManager for Siren

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct PresentationManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + RulesManager + +
      +
      +
      +
      +
      +
      +

      RulesManager for Siren

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct RulesManager
      -

      As SirenAlertMessaging is a Struct, one or more keys can be modified. Overriding only one string will result in the other keys retaining their default (and internationalizable) values.

      +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + AlertConstants + +
      +
      +
      +
      +
      +
      +

      The default constants used for the update alert’s messaging.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct AlertConstants
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Localization + +
      +
      +
      +
      +
      +
      +

      Localization information and strings for Siren.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Localization
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + LookupModel + +
      +
      +
      +
      +
      +
      +

      Model representing a selection of results from the iTunes Lookup API.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct LookupModel : Decodable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Results + +
      +
      +
      +
      +
      +
      +

      The relevant metadata returned from Siren upon completing a successful version check.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenAlertMessaging
      +
      public struct Results
      @@ -140,20 +360,13 @@

      Declaration

    -
    • - - - SirenLookupModel + + + Rules
      @@ -161,15 +374,15 @@

      Model representing a selection of results from the iTun
      -

      MARK: Siren extension used to parse and map the iTunes JSON results into a model represented in Swift.

      +

      Alert Presentation Rules for Siren.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenLookupModel : Decodable
      +
      public struct Rules
      @@ -179,20 +392,13 @@

      Declaration

    -
    • - - - SirenError + + + DataParser
      @@ -200,15 +406,15 @@

      Siren Error Handling

      -

      Data structure used to build Siren specific Errors.

      +

      Version parsing functions for Siren.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenError : LocalizedError
      +
      struct DataParser
      @@ -220,7 +426,7 @@

      Declaration

    diff --git a/docs/Structs/APIManager.html b/docs/Structs/APIManager.html new file mode 100644 index 00000000..57385729 --- /dev/null +++ b/docs/Structs/APIManager.html @@ -0,0 +1,494 @@ + + + + APIManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    APIManager

    +
    +
    +
    public struct APIManager
    + +
    +
    +

    APIManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      Constants used in the APIManager.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private struct Constants
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + CompletionHandler + +
      +
      +
      +
      +
      +
      +

      Return results or errors obtained from performing a version check with Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      typealias CompletionHandler = (LookupModel?, KnownError?) -> Void
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + countryCode + +
      +
      +
      +
      +
      +
      +

      The region or country of an App Store in which the app is available. +By default, all version check requests are performed against the US App Store. +If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.

      + +

      List of country codes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let countryCode: String?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + init(countryCode:) + +
      +
      +
      +
      +
      +
      +

      Initializes APIManager to the region or country of an App Store in which the app is available. +By default, all version check requests are performed against the US App Store. +If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.

      + +

      List of country codes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(countryCode: String? = nil)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + countryCode + + +
      +

      The country code for the App Store in which the app is availabe. Defaults to nil (e.g., the US App Store)

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default APIManager.

      + +

      The version check is performed against the US App Store.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: APIManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Creates and performs a URLRequest against the iTunes Lookup API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func performVersionCheckRequest(completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler for the iTunes Lookup API request.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Parses and maps the the results from the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func processVersionCheckResults(withData data: Data?,
      +                                        response: URLResponse?,
      +                                        error: Error?,
      +                                        completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + data + + +
      +

      The JSON data returned from the request.

      +
      +
      + + response + + +
      +

      The response metadata returned from the request.

      +
      +
      + + error + + +
      +

      The error returned from the request.

      +
      +
      + + handler + + +
      +

      The completion handler to call once the results of the request has been processed.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + makeITunesURL() + +
      +
      +
      +
      +
      +
      +

      Creates the URL that points to the iTunes Lookup API.

      +
      +

      Throws

      + An error if the URL cannot be created. + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func makeITunesURL() throws -> URL
      + +
      +
      +
      +

      Return Value

      +

      The iTunes Lookup API URL.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/APIManager/Constants.html b/docs/Structs/APIManager/Constants.html new file mode 100644 index 00000000..645afd45 --- /dev/null +++ b/docs/Structs/APIManager/Constants.html @@ -0,0 +1,212 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    private struct Constants
    + +
    +
    +

    Constants used in the APIManager.

    + +
    +
    +
    +
      +
    • +
      + + + + bundleID + +
      +
      +
      +
      +
      +
      +

      Constant for the bundleId parameter in the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let bundleID: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + country + +
      +
      +
      +
      +
      +
      +

      Constant for the country parameter in the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let country: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/AlertConstants.html b/docs/Structs/AlertConstants.html new file mode 100644 index 00000000..2717d6dc --- /dev/null +++ b/docs/Structs/AlertConstants.html @@ -0,0 +1,293 @@ + + + + AlertConstants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertConstants

    +
    +
    +
    public struct AlertConstants
    + +
    +
    +

    The default constants used for the update alert’s messaging.

    + +
    +
    +
    +
      +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that there is an app update available

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertMessage: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The alert title which defaults to Update Available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user should be prompted to update next time the app launches.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let nextTimeButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that the the user wants to skip this verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let skipButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user would like to update the app right away.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let updateButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/AlertMessaging.html b/docs/Structs/AlertMessaging.html new file mode 100644 index 00000000..4984c1c1 --- /dev/null +++ b/docs/Structs/AlertMessaging.html @@ -0,0 +1,250 @@ + + + + AlertMessaging Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertMessaging

    +
    +
    +
    public struct AlertMessaging
    + +
    +
    +

    Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

    +
    +

    Warning

    + Overriding any of these keys will result in the loss of the built-in internationalization that Siren provides. + +
    + +

    As SirenAlertMessaging is a Struct, one or more keys can be modified. Overriding only one string will result in the other keys retaining their default (and internationalizable) values.

    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      The default constants used for the alert messaging.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Constants
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The public initializer

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(updateTitle title: NSAttributedString  = Constants.alertTitle,
      +            updateMessage message: NSAttributedString  = Constants.alertMessage,
      +            updateButtonMessage: NSAttributedString  = Constants.updateButtonTitle,
      +            nextTimeButtonMessage: NSAttributedString  = Constants.nextTimeButtonTitle,
      +            skipVersionButtonMessage: NSAttributedString  = Constants.skipButtonTitle)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + +
      + + title + + +
      +

      The title field of the UIAlertController.

      +
      +
      + + message + + +
      +

      The message field of the UIAlertController.

      +
      +
      + + updateButtonMessage + + +
      +

      The title field of the Update Button UIAlertAction.

      +
      +
      + + nextTimeButtonMessage + + +
      +

      The title field of the Next Time Button UIAlertAction.

      +
      +
      + + skipVersionButtonMessage + + +
      +

      The title field of the Skip Button UIAlertAction.

      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/AlertMessaging/Constants.html b/docs/Structs/AlertMessaging/Constants.html new file mode 100644 index 00000000..5b9d5c7f --- /dev/null +++ b/docs/Structs/AlertMessaging/Constants.html @@ -0,0 +1,252 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    public struct Constants
    + +
    +
    +

    The default constants used for the alert messaging.

    + +
    +
    +
    +
      +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that there is an app update available

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertMessage: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The alert title which defaults to Update Available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user should be prompted to update next time the app launches.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let nextTimeButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that the the user wants to skip this verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let skipButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user would like to update the app right away.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let updateButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/CapturedError.html b/docs/Structs/CapturedError.html new file mode 100644 index 00000000..bce35f56 --- /dev/null +++ b/docs/Structs/CapturedError.html @@ -0,0 +1,158 @@ + + + + CapturedError Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CapturedError

    +
    +
    +
    public struct CapturedError : LocalizedError
    + +
    +
    +

    Siren extension dealing with Siren-specific errors.

    + +
    +
    +
    +
      +
    • +
      + + + + Known + +
      +
      +
      +
      +
      +
      +

      Enumerates all potentials errors that Siren can handle.

      + +
        +
      • appStoreAppIDFailure: Error retrieving trackId as the JSON does not contain a ‘trackId’ key.
      • +
      • appStoreDataRetrievalFailure: Error retrieving App Store data as an error was returned.
      • +
      • appStoreJSONParsingFailure: Error parsing App Store JSON data.
      • +
      • appStoreDataRetrievalEmptyResults: Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.
      • +
      • appStoreOSVersionNumberFailure: Error retrieving iOS version number as there was no data returned.
      • +
      • appStoreOSVersionUnsupported: The version of iOS on the device is lower than that of the one required by the app verison update.
      • +
      • appStoreVersionArrayFailure: Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.
      • +
      • malformedURL: The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
      • +
      • noUpdateAvailable: No new update available.
      • +
      • recentlyCheckedAlready: Not checking the version, because it was already checked recently.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum Known : Error
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/CapturedError/Known.html b/docs/Structs/CapturedError/Known.html new file mode 100644 index 00000000..dc1c8aaa --- /dev/null +++ b/docs/Structs/CapturedError/Known.html @@ -0,0 +1,400 @@ + + + + Known Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Known

    +
    +
    +
    public enum Known : Error
    + +
    +
    +

    Enumerates all potentials errors that Siren can handle.

    + +
      +
    • appStoreAppIDFailure: Error retrieving trackId as the JSON does not contain a ‘trackId’ key.
    • +
    • appStoreDataRetrievalFailure: Error retrieving App Store data as an error was returned.
    • +
    • appStoreJSONParsingFailure: Error parsing App Store JSON data.
    • +
    • appStoreDataRetrievalEmptyResults: Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.
    • +
    • appStoreOSVersionNumberFailure: Error retrieving iOS version number as there was no data returned.
    • +
    • appStoreOSVersionUnsupported: The version of iOS on the device is lower than that of the one required by the app verison update.
    • +
    • appStoreVersionArrayFailure: Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.
    • +
    • malformedURL: The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
    • +
    • noUpdateAvailable: No new update available.
    • +
    • recentlyCheckedAlready: Not checking the version, because it was already checked recently.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + appStoreAppIDFailure + +
      +
      +
      +
      +
      +
      +

      Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreAppIDFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as an error was returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalFailure(underlyingError: Error?)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error parsing App Store JSON data.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreJSONParsingFailure(underlyingError: Error)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalEmptyResults
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving iOS version number as there was no data returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionNumberFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The version of iOS on the device is lower than that of the one required by the app verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionUnsupported
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreVersionArrayFailure
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malformedURL + +
      +
      +
      +
      +
      +
      +

      The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malformedURL
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + noUpdateAvailable + +
      +
      +
      +
      +
      +
      +

      No new update available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case noUpdateAvailable
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Not checking the version, because it was already checked recently.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case recentlyCheckedAlready
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Constants.html b/docs/Structs/Constants.html new file mode 100644 index 00000000..d85e5cfa --- /dev/null +++ b/docs/Structs/Constants.html @@ -0,0 +1,211 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    public struct Constants
    + +
    +
    +

    Lists all enumerated types that are used to configure the library.

    + +
    +
    +
    +
      +
    • +
      + + + + AlertType + +
      +
      +
      +
      +
      +
      +

      Determines the type of alert to present after a successful version check has been performed.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + UpdateType + +
      +
      +
      +
      +
      +
      +

      UpdateType defines what kind of update is available. +It is used as a parameter if the user wants to use +a custom alert to inform the user about an update.

      + +
        +
      • major: Major release available: A.b.c.d
      • +
      • minor: Minor release available: a.B.c.d
      • +
      • patch: Patch release available: a.b.C.d
      • +
      • revision: Revision release available: a.b.c.D
      • +
      • unknown: No information available about the update.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdateType : String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + VersionCheckFrequency + +
      +
      +
      +
      +
      +
      +

      Determines the frequency in which the the version check is performed and the user is prompted to update the app.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum VersionCheckFrequency : Int
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Constants/AlertType.html b/docs/Structs/Constants/AlertType.html new file mode 100644 index 00000000..a24bea17 --- /dev/null +++ b/docs/Structs/Constants/AlertType.html @@ -0,0 +1,226 @@ + + + + AlertType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertType

    +
    +
    +
    public enum AlertType
    + +
    +
    +

    Determines the type of alert to present after a successful version check has been performed.

    + +
    +
    +
    +
      +
    • +
      + + + + force + +
      +
      +
      +
      +
      +
      +

      Forces user to update your app (1 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case force
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + option + +
      +
      +
      +
      +
      +
      +

      (DEFAULT) Presents user with option to update app now or at next launch (2 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case option
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + none + +
      +
      +
      +
      +
      +
      +

      Doesn’t show the alert, but instead returns a localized message +for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case none
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Constants/UpdateType.html b/docs/Structs/Constants/UpdateType.html new file mode 100644 index 00000000..7633d0ac --- /dev/null +++ b/docs/Structs/Constants/UpdateType.html @@ -0,0 +1,262 @@ + + + + UpdateType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdateType

    +
    +
    +
    public enum UpdateType : String
    + +
    +
    +

    UpdateType defines what kind of update is available. +It is used as a parameter if the user wants to use +a custom alert to inform the user about an update.

    + +
      +
    • major: Major release available: A.b.c.d
    • +
    • minor: Minor release available: a.B.c.d
    • +
    • patch: Patch release available: a.b.C.d
    • +
    • revision: Revision release available: a.b.c.D
    • +
    • unknown: No information available about the update.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + major + +
      +
      +
      +
      +
      +
      +

      Major release available: A.b.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case major
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minor + +
      +
      +
      +
      +
      +
      +

      Minor release available: a.B.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minor
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patch + +
      +
      +
      +
      +
      +
      +

      Patch release available: a.b.C.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case patch
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revision + +
      +
      +
      +
      +
      +
      +

      Revision release available: a.b.c.D

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case revision
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      No information available about the update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Constants/VersionCheckFrequency.html b/docs/Structs/Constants/VersionCheckFrequency.html new file mode 100644 index 00000000..c1c179fc --- /dev/null +++ b/docs/Structs/Constants/VersionCheckFrequency.html @@ -0,0 +1,198 @@ + + + + VersionCheckFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    VersionCheckFrequency

    +
    +
    +
    public enum VersionCheckFrequency : Int
    + +
    +
    +

    Determines the frequency in which the the version check is performed and the user is prompted to update the app.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/DataParser.html b/docs/Structs/DataParser.html new file mode 100644 index 00000000..739b616c --- /dev/null +++ b/docs/Structs/DataParser.html @@ -0,0 +1,385 @@ + + + + DataParser Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    DataParser

    +
    +
    +
    struct DataParser
    + +
    +
    +

    Version parsing functions for Siren.

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Checks to see if the App Store version of the app is newer than the installed version.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func isAppStoreVersionNewer(installedVersion: String?, appStoreVersion: String?) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + installedVersion + + +
      +

      The installed version of the app.

      +
      +
      + + appStoreVersion + + +
      +

      The App Store version of the app.

      +
      +
      +
      +
      +

      Return Value

      +

      true if the App Store version is newer. Otherwise, false.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Validates that the latest version in the App Store is compatible with the device’s current version of iOS.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func isUpdateCompatibleWithDeviceOS(for model: LookupModel) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      +
      +
      +

      Return Value

      +

      true if the latest version is compatible with the device’s current version of iOS. Otherwise, false.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The type of update that is returned from the API in relation to the verison of the app that is installed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func parseForUpdate(forInstalledVersion installedVersion: String?,
      +                           andAppStoreVersion appStoreVersion: String?) -> RulesManager.UpdateType
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + installedVersion + + +
      +

      The installed version of the app.

      +
      +
      + + appStoreVersion + + +
      +

      The App Store version of the app.

      +
      +
      +
      +
      +

      Return Value

      +

      The type of update in relation to the verison of the app that is installed.

      +
      +
      +
      +
    • +
    • +
      + + + + split(version:) + +
      +
      +
      +
      +
      +
      +

      Splits a version-formatted String into an[Int]`.

      + +

      Converts "a.b.c.d" into [a, b, c, d].

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private static func split(version: String) -> [Int]
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + version + + +
      +

      The version formatted String.

      +
      +
      +
      +
      +

      Return Value

      +

      An array of integers representing a version of the app.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Localization.html b/docs/Structs/Localization.html new file mode 100644 index 00000000..78a6c884 --- /dev/null +++ b/docs/Structs/Localization.html @@ -0,0 +1,458 @@ + + + + Localization Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Localization

    +
    +
    +
    public struct Localization
    + +
    +
    +

    Localization information and strings for Siren.

    + +
    +
    +
    +
      +
    • +
      + + + + Language + +
      +
      +
      +
      +
      +
      +

      Determines the available languages in which the update message and alert button titles should appear.

      + +

      By default, the operating system’s default lanuage setting is used. However, you can force a specific language +by setting the forceLanguageLocalization property before calling checkVersion()

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum Language : String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + appName + +
      +
      +
      +
      +
      +
      +

      The name of the app as defined by the Info.plist.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var appName: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + forceLanguage + +
      +
      +
      +
      +
      +
      +

      Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.

      + +

      See the Siren.Localization.Language enum for more details.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private let forceLanguage: Language?
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      init(appName: String?, andForceLanguageLocalization forceLanguage: Language?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + appName + + +
      +

      Overrides the default name of the app. This is optional and defaults to the app that is defined in the Info.plist.

      +
      +
      + + forceLanguage + + +
      +

      The language the alert to which the alert should be set. If nil, it falls back to the device’s preferred locale.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The localized string for the UIAlertController‘s message field. .

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func alertMessage(forCurrentAppStoreVersion currentAppStoreVersion: String) -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the update message.

      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the UIAlertController‘s title field. .

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func alertTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Update Available.

      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Next time UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func nextTimeButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Next time.

      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Skip this version UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func skipButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Skip this version.

      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Update UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func updateButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Update.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Localization/Language.html b/docs/Structs/Localization/Language.html new file mode 100644 index 00000000..a1e50087 --- /dev/null +++ b/docs/Structs/Localization/Language.html @@ -0,0 +1,1295 @@ + + + + Language Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Language

    +
    +
    +
    public enum Language : String
    + +
    +
    +

    Determines the available languages in which the update message and alert button titles should appear.

    + +

    By default, the operating system’s default lanuage setting is used. However, you can force a specific language +by setting the forceLanguageLocalization property before calling checkVersion()

    + +
    +
    +
    +
      +
    • +
      + + + + arabic + +
      +
      +
      +
      +
      +
      +

      Arabic Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case arabic = "ar"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + armenian + +
      +
      +
      +
      +
      +
      +

      Armenian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case armenian = "hy"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + basque + +
      +
      +
      +
      +
      +
      +

      Basque Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case basque = "eu"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + chineseSimplified + +
      +
      +
      +
      +
      +
      +

      Simplified Chinese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case chineseSimplified = "zh-Hans"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + chineseTraditional + +
      +
      +
      +
      +
      +
      +

      Traditional Chinese Localization Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case chineseTraditional = "zh-Hant"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + croatian + +
      +
      +
      +
      +
      +
      +

      Croatian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case croatian = "hr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + czech + +
      +
      +
      +
      +
      +
      +

      Czech Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case czech = "cs"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + danish + +
      +
      +
      +
      +
      +
      +

      Danish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case danish = "da"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + dutch + +
      +
      +
      +
      +
      +
      +

      Dutch Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case dutch = "nl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + english + +
      +
      +
      +
      +
      +
      +

      English Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case english = "en"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + estonian + +
      +
      +
      +
      +
      +
      +

      Estonian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case estonian = "et"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + finnish + +
      +
      +
      +
      +
      +
      +

      Finnish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case finnish = "fi"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + french + +
      +
      +
      +
      +
      +
      +

      French Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case french = "fr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + german + +
      +
      +
      +
      +
      +
      +

      German Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case german = "de"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + greek + +
      +
      +
      +
      +
      +
      +

      Greek Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case greek = "el"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + hebrew + +
      +
      +
      +
      +
      +
      +

      Hebrew Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case hebrew = "he"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + hungarian + +
      +
      +
      +
      +
      +
      +

      Hungarian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case hungarian = "hu"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + indonesian + +
      +
      +
      +
      +
      +
      +

      Indonesian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case indonesian = "id"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + italian + +
      +
      +
      +
      +
      +
      +

      Italian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case italian = "it"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + japanese + +
      +
      +
      +
      +
      +
      +

      Japanese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case japanese = "ja"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + korean + +
      +
      +
      +
      +
      +
      +

      Korean Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case korean = "ko"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + latvian + +
      +
      +
      +
      +
      +
      +

      Latvian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case latvian = "lv"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + lithuanian + +
      +
      +
      +
      +
      +
      +

      Lithuanian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case lithuanian = "lt"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malay + +
      +
      +
      +
      +
      +
      +

      Malay Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malay = "ms"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + norwegian + +
      +
      +
      +
      +
      +
      +

      Norwegian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case norwegian = "nb-NO"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persian + +
      +
      +
      +
      +
      +
      +

      Persian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persian = "fa"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persianAfghanistan + +
      +
      +
      +
      +
      +
      +

      Persian (Afghanistan) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persianAfghanistan = "fa-AF"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persianIran + +
      +
      +
      +
      +
      +
      +

      Persian (Iran) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persianIran = "fa-IR"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + polish + +
      +
      +
      +
      +
      +
      +

      Polish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case polish = "pl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + portugueseBrazil + +
      +
      +
      +
      +
      +
      +

      Brazilian Portuguese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case portugueseBrazil = "pt"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + portuguesePortugal + +
      +
      +
      +
      +
      +
      +

      Portugal’s Portuguese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case portuguesePortugal = "pt-PT"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + russian + +
      +
      +
      +
      +
      +
      +

      Russian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case russian = "ru"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + serbianCyrillic + +
      +
      +
      +
      +
      +
      +

      Serbian (Cyrillic) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case serbianCyrillic = "sr-Cyrl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + serbianLatin + +
      +
      +
      +
      +
      +
      +

      Serbian (Latin) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case serbianLatin = "sr-Latn"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + slovenian + +
      +
      +
      +
      +
      +
      +

      Slovenian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case slovenian = "sl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + spanish + +
      +
      +
      +
      +
      +
      +

      Spanish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case spanish = "es"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + swedish + +
      +
      +
      +
      +
      +
      +

      Swedish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case swedish = "sv"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + thai + +
      +
      +
      +
      +
      +
      +

      Thai Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case thai = "th"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + turkish + +
      +
      +
      +
      +
      +
      +

      Turkish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case turkish = "tr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + urdu + +
      +
      +
      +
      +
      +
      +

      Urdu Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case urdu = "ur"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + ukrainian + +
      +
      +
      +
      +
      +
      +

      Ukranian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case ukrainian = "uk"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + vietnamese + +
      +
      +
      +
      +
      +
      +

      Vietnamese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case vietnamese = "vi"
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/LookupModel.html b/docs/Structs/LookupModel.html new file mode 100644 index 00000000..ad08f39d --- /dev/null +++ b/docs/Structs/LookupModel.html @@ -0,0 +1,241 @@ + + + + LookupModel Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    LookupModel

    +
    +
    +
    public struct LookupModel : Decodable
    + +
    +
    +

    Model representing a selection of results from the iTunes Lookup API.

    + +
    +
    +
    +
      +
    • +
      + + + + CodingKeys + +
      +
      +
      +
      +
      +
      +

      Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum CodingKeys : String, CodingKey
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + results + +
      +
      +
      +
      +
      +
      +

      The array of results objects from the iTunes Lookup API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let results: [Results]
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + Results + +
      +
      +
      +
      +
      +
      +

      The Results object from the the iTunes Lookup API.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Results : Decodable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/LookupModel/CodingKeys.html b/docs/Structs/LookupModel/CodingKeys.html new file mode 100644 index 00000000..8bae8fe4 --- /dev/null +++ b/docs/Structs/LookupModel/CodingKeys.html @@ -0,0 +1,185 @@ + + + + CodingKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CodingKeys

    +
    +
    +
    private enum CodingKeys : String, CodingKey
    + +
    +
    +

    Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

    + +
    +
    +
    +
      +
    • +
      + + + + results + +
      +
      +
      +
      +
      +
      +

      The results JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case results
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/LookupModel/Results.html b/docs/Structs/LookupModel/Results.html new file mode 100644 index 00000000..6158798d --- /dev/null +++ b/docs/Structs/LookupModel/Results.html @@ -0,0 +1,321 @@ + + + + Results Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Results

    +
    +
    +
    public struct Results : Decodable
    + +
    +
    +

    The Results object from the the iTunes Lookup API.

    + +
    +
    +
    +
      +
    • +
      + + + + CodingKeys + +
      +
      +
      +
      +
      +
      +

      Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum CodingKeys : String, CodingKey
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + appID + +
      +
      +
      +
      +
      +
      +

      The app’s App ID.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let appID: Int
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The release date for the latest verison of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let currentVersionReleaseDate: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minimumOSVersion + +
      +
      +
      +
      +
      +
      +

      The minimum verison of iOS that the current verison of the app requires.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let minimumOSVersion: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + releaseNotes + +
      +
      +
      +
      +
      +
      +

      The releases notes from the latest version of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let releaseNotes: String?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version + +
      +
      +
      +
      +
      +
      +

      The latest version of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let version: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/LookupModel/Results/CodingKeys.html b/docs/Structs/LookupModel/Results/CodingKeys.html new file mode 100644 index 00000000..0560df9b --- /dev/null +++ b/docs/Structs/LookupModel/Results/CodingKeys.html @@ -0,0 +1,293 @@ + + + + CodingKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CodingKeys

    +
    +
    +
    private enum CodingKeys : String, CodingKey
    + +
    +
    +

    Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

    + +
    +
    +
    +
      +
    • +
      + + + + appID + +
      +
      +
      +
      +
      +
      +

      The appID JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appID = "trackId"
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The current version release date JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case currentVersionReleaseDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minimumOSVersion + +
      +
      +
      +
      +
      +
      +

      The minimum device iOS version compatibility JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minimumOSVersion = "minimumOsVersion"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + releaseNotes + +
      +
      +
      +
      +
      +
      +

      The release notes JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case releaseNotes
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version + +
      +
      +
      +
      +
      +
      +

      The current App Store version JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case version
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/PresentationManager.html b/docs/Structs/PresentationManager.html new file mode 100644 index 00000000..36ed26af --- /dev/null +++ b/docs/Structs/PresentationManager.html @@ -0,0 +1,838 @@ + + + + PresentationManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    PresentationManager

    +
    +
    +
    public struct PresentationManager
    + +
    +
    +

    PresentationManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + CompletionHandler + +
      +
      +
      +
      +
      +
      +

      Return results or errors obtained from performing a version check with Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      typealias CompletionHandler = (AlertAction) -> Void
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localization + +
      +
      +
      +
      +
      +
      +

      The localization data structure that will be used to construct localized strings for the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let localization: Localization
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + tintColor + +
      +
      +
      +
      +
      +
      +

      The tint color of the UIAlertController buttons.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let tintColor: UIColor?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The descriptive update message of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertMessage: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The main message of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Next time button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let nextTimeButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Skip this version button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let skipButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Update button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let updateButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertController + +
      +
      +
      +
      +
      +
      +

      The instance of the UIAlertController used to present the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var alertController: UIAlertController?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updaterWindow + +
      +
      +
      +
      +
      +
      +

      The UIWindow instance that presents the SirenViewController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var updaterWindow: UIWindow { get }
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      PresentationManager‘s public initializer.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(alertTintColor tintColor: UIColor? = nil,
      +            appName: String? = nil,
      +            alertTitle: String  = AlertConstants.alertTitle,
      +            alertMessage: String  = AlertConstants.alertMessage,
      +            updateButtonTitle: String  = AlertConstants.updateButtonTitle,
      +            nextTimeButtonTitle: String  = AlertConstants.nextTimeButtonTitle,
      +            skipButtonTitle: String  = AlertConstants.skipButtonTitle,
      +            forceLanguageLocalization forceLanguage: Localization.Language? = nil)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + tintColor + + +
      +

      The alert’s tintColor. Settings this to nil defaults to the system default color.

      +
      +
      + + appName + + +
      +

      The name of the app (overrides the default/bundled name).

      +
      +
      + + alertTitle + + +
      +

      The title field of the UIAlertController.

      +
      +
      + + alertMessage + + +
      +

      The message field of the UIAlertController.

      +
      +
      + + nextTimeButtonTitle + + +
      +

      The title field of the Next Time Button UIAlertAction.

      +
      +
      + + skipButtonTitle + + +
      +

      The title field of the Skip Button UIAlertAction.

      +
      +
      + + updateButtonTitle + + +
      +

      The title field of the Update Button UIAlertAction.

      +
      +
      + + forceLanguage + + +
      +

      The language the alert to which the alert should be set. If nil, it falls back to the device’s preferred locale.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default PresentationManager.

      + +

      By default:

      + +
        +
      • There is no tint color (defaults to Apple’s system blue color.)
      • +
      • The name of the app is equal to the name that appears in Info.plist.
      • +
      • The strings are all set to that of the user’s device localization (if supported) or it falls back to English.
      • +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: PresentationManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Constructs the localized update alert UIAlertController object.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      mutating func presentAlert(withRules rules: Rules,
      +                           forCurrentAppStoreVersion currentAppStoreVersion: String,
      +                           completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that are used to define the type of alert that should be presented.

      +
      +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + handler + + +
      +

      The completion handler that returns the an AlertAction depending on the type of action the end-user took.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Update option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func updateAlertAction(completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler that returns the .update option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Update alert action.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Next time option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func nextTimeAlertAction(completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler that returns the .nextTime option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Next time alert action.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Skip this version option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func skipAlertAction(forCurrentAppStoreVersion currentAppStoreVersion: String, completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + handler + + +
      +

      The completion handler that returns the .skip option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Skip this version alert action.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Results.html b/docs/Structs/Results.html new file mode 100644 index 00000000..b2deed5f --- /dev/null +++ b/docs/Structs/Results.html @@ -0,0 +1,267 @@ + + + + Results Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Results

    +
    +
    +
    public struct Results
    + +
    +
    +

    The relevant metadata returned from Siren upon completing a successful version check.

    + +
    +
    +
    +
      +
    • +
      + + + + alertAction + +
      +
      +
      +
      +
      +
      +

      The UIAlertAction the user chose upon being presented with the update alert. +Defaults to unknown until an alert is actually presented.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var alertAction: AlertAction
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localization + +
      +
      +
      +
      +
      +
      +

      The Siren-supported locale that was used for the string in the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var localization: Localization
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + lookupModel + +
      +
      +
      +
      +
      +
      +

      The Swift-mapped API model, if a successful version check was performed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var lookupModel: LookupModel
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateType + +
      +
      +
      +
      +
      +
      +

      The type of update that was returned for the API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var updateType: RulesManager.UpdateType
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Rules.html b/docs/Structs/Rules.html new file mode 100644 index 00000000..8d6d2ae2 --- /dev/null +++ b/docs/Structs/Rules.html @@ -0,0 +1,472 @@ + + + + Rules Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Rules

    +
    +
    +
    public struct Rules
    + +
    +
    +

    Alert Presentation Rules for Siren.

    + +
    +
    +
    +
      +
    • +
      + + + + alertType + +
      +
      +
      +
      +
      +
      +

      The type of alert that should be presented.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertType: AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + frequency + +
      +
      +
      +
      +
      +
      +

      The frequency in which a the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let frequency: UpdatePromptFrequency
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializes the alert presentation rules.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(promptFrequency frequency: UpdatePromptFrequency,
      +            forAlertType alertType: AlertType)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + frequency + + +
      +

      How often a user should be prompted to update the app once a new version is available in the App Store.

      +
      +
      + + alertType + + +
      +

      The type of alert that should be presented.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + annoying + +
      +
      +
      +
      +
      +
      +

      Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var annoying: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + critical + +
      +
      +
      +
      +
      +
      +

      Performs a version check immediately and forces the user to update the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var critical: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      Performs a version check once a day, but allows the user to skip updating the app until +the next time the app becomes active or skipping the update all together until another version is released.

      + +

      This is the default setting.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var `default`: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persistent + +
      +
      +
      +
      +
      +
      +

      Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var persistent: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + relaxed + +
      +
      +
      +
      +
      +
      +

      Performs a version check weekly, but allows the user to skip updating the app until +the next time the app becomes active or skipping the update all together until another version is released.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var relaxed: Rules { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + AlertType + +
      +
      +
      +
      +
      +
      +

      Determines the type of alert to present after a successful version check has been performed.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + UpdatePromptFrequency + +
      +
      +
      +
      +
      +
      +

      Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdatePromptFrequency : UInt
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Rules/AlertType.html b/docs/Structs/Rules/AlertType.html new file mode 100644 index 00000000..a339ed4b --- /dev/null +++ b/docs/Structs/Rules/AlertType.html @@ -0,0 +1,267 @@ + + + + AlertType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertType

    +
    +
    +
    public enum AlertType
    + +
    +
    +

    Determines the type of alert to present after a successful version check has been performed.

    + +
    +
    +
    +
      +
    • +
      + + + + force + +
      +
      +
      +
      +
      +
      +

      Forces the user to update your app (1 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case force
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + option + +
      +
      +
      +
      +
      +
      +

      Presents the user with option to update app now or at next launch (2 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case option
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + none + +
      +
      +
      +
      +
      +
      +

      Doesn’t present the alert. +Use this option if you would like to present a custom alert to the end-user.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case none
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Rules/UpdatePrompFrequency.html b/docs/Structs/Rules/UpdatePrompFrequency.html new file mode 100644 index 00000000..85e98ed6 --- /dev/null +++ b/docs/Structs/Rules/UpdatePrompFrequency.html @@ -0,0 +1,237 @@ + + + + UpdatePrompFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (66% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdatePrompFrequency

    +
    +
    +
    public enum UpdatePrompFrequency : UInt
    + +
    +
    +

    Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/Rules/UpdatePromptFrequency.html b/docs/Structs/Rules/UpdatePromptFrequency.html new file mode 100644 index 00000000..d04dfa75 --- /dev/null +++ b/docs/Structs/Rules/UpdatePromptFrequency.html @@ -0,0 +1,240 @@ + + + + UpdatePromptFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdatePromptFrequency

    +
    +
    +
    public enum UpdatePromptFrequency : UInt
    + +
    +
    +

    Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/RulesManager.html b/docs/Structs/RulesManager.html new file mode 100644 index 00000000..b9b2be68 --- /dev/null +++ b/docs/Structs/RulesManager.html @@ -0,0 +1,570 @@ + + + + RulesManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    RulesManager

    +
    +
    +
    public struct RulesManager
    + +
    +
    +

    RulesManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + releasedForDays + +
      +
      +
      +
      +
      +
      +

      The alert will only show up if the current version has already been released for X days.

      + +

      This value defaults to 1 day (in RulesManager‘s initializer) to avoid an issue where +Apple updates the JSON faster than the app binary propogates to the App Store.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let releasedForDays: Int
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + majorUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a major version update (A.b.c.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var majorUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minorUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a minor version update (a.B.c.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var minorUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patchUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a patch version update (a.b.C.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var patchUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revisionUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a revision version update (a.b.c.D).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var revisionUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializer that sets update-specific Rules for all updates (e.g., major, minor, patch, revision). +This means that each of the four update types can have their own specific update rules.

      + +

      By default, the releasedForDays parameter delays the update alert from being presented for 1 day +to avoid an issue where the iTunes Lookup API response is updated faster than the time it takes for the binary +to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the 1 day delay.

      +
      +

      Warning

      +

      Setting releasedForDays to 0 days causes the alert to appear right away, even if the binary isn’t available. +If this value is set to 0 days, and an AlertType of type .force is set, it will cause your app to infinitely send the +end-user to the App Store to download a version that’s not there and lock them out of your application until the binary is +is available to be downloaded.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(majorUpdateRules: Rules = .default,
      +            minorUpdateRules: Rules = .default,
      +            patchUpdateRules: Rules = .default,
      +            revisionUpdateRules: Rules = .default,
      +            showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that should be set for all version updates.

      +
      +
      + + releasedForDays + + +
      +

      The amount of time (in days) that the app should delay before presenting the user

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializer that sets the same update Rules for all types of updates (e.g., major, minor, patch, revision). +This means that all four update types will use the same presentation rules.

      + +

      By default, the releasedForDays parameter delays the update alert from being presented for 1 day +to avoid an issue where the iTunes Lookup API response is updated faster than the time it takes for the binary +to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the 1 day delay.

      +
      +

      Warning

      +

      Setting releasedForDays to 0 days causes the alert to appear right away, even if the binary isn’t available. +If this value is set to 0 days, and an AlertType of type .force is set, it will cause your app to infinitely send the +end-user to the App Store to download a version that’s not there and lock them out of your application until the binary is +is available to be downloaded.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(globalRules rules: Rules = .default,
      +            showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that should be set for all version updates.

      +
      +
      + + releasedForDays + + +
      +

      The amount of time (in days) that the app should delay before presenting the user

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Returns the appropriate update rules based on the type of version that is returned from the API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func loadRulesForUpdateType(_ type: UpdateType) -> Rules
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + type + + +
      +

      The type of app update.

      +
      +
      +
      +
      +

      Return Value

      +

      The appropriate rule based on the type of app update that is returned by the API.

      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default RulesManager.

      + +

      By default, the Rules.default rule is used for all update typs.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: RulesManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    + +
      +
    • +
      + + + + UpdateType + +
      +
      +
      +
      +
      +
      +

      Informs Siren of the type of update that is available so that +the appropriate ruleset is used to present the update alert.

      + +
        +
      • major: Major release available: A.b.c.d
      • +
      • minor: Minor release available: a.B.c.d
      • +
      • patch: Patch release available: a.b.C.d
      • +
      • revision: Revision release available: a.b.c.D
      • +
      • unknown: No information available about the update.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdateType : String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/RulesManager/UpdateType.html b/docs/Structs/RulesManager/UpdateType.html new file mode 100644 index 00000000..c061dcb7 --- /dev/null +++ b/docs/Structs/RulesManager/UpdateType.html @@ -0,0 +1,302 @@ + + + + UpdateType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdateType

    +
    +
    +
    public enum UpdateType : String
    + +
    +
    +

    Informs Siren of the type of update that is available so that +the appropriate ruleset is used to present the update alert.

    + +
      +
    • major: Major release available: A.b.c.d
    • +
    • minor: Minor release available: a.B.c.d
    • +
    • patch: Patch release available: a.b.C.d
    • +
    • revision: Revision release available: a.b.c.D
    • +
    • unknown: No information available about the update.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + major + +
      +
      +
      +
      +
      +
      +

      Major release available: A.b.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case major
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minor + +
      +
      +
      +
      +
      +
      +

      Minor release available: a.B.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minor
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patch + +
      +
      +
      +
      +
      +
      +

      Patch release available: a.b.C.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case patch
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revision + +
      +
      +
      +
      +
      +
      +

      Revision release available: a.b.c.D

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case revision
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      No information available about the update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Structs/SirenAlertMessaging.html b/docs/Structs/SirenAlertMessaging.html index 8afae6bf..912a86f1 100644 --- a/docs/Structs/SirenAlertMessaging.html +++ b/docs/Structs/SirenAlertMessaging.html @@ -139,9 +139,9 @@

    Declaration

  • @@ -239,7 +239,7 @@

    Parameters

    diff --git a/docs/Structs/SirenAlertMessaging/Constants.html b/docs/Structs/SirenAlertMessaging/Constants.html index 9aa14fd1..a0c6d8aa 100644 --- a/docs/Structs/SirenAlertMessaging/Constants.html +++ b/docs/Structs/SirenAlertMessaging/Constants.html @@ -241,7 +241,7 @@

    Declaration

    diff --git a/docs/Structs/SirenError.html b/docs/Structs/SirenError.html index 22344b0a..72b4ead7 100644 --- a/docs/Structs/SirenError.html +++ b/docs/Structs/SirenError.html @@ -147,7 +147,7 @@

    Declaration

    diff --git a/docs/Structs/SirenError/Known.html b/docs/Structs/SirenError/Known.html index b318c9d3..89f03cbc 100644 --- a/docs/Structs/SirenError/Known.html +++ b/docs/Structs/SirenError/Known.html @@ -117,9 +117,9 @@

    Known

  • @@ -144,9 +144,9 @@

    Declaration

  • @@ -171,9 +171,9 @@

    Declaration

  • @@ -198,9 +198,9 @@

    Declaration

  • @@ -225,9 +225,9 @@

    Declaration

  • @@ -252,9 +252,9 @@

    Declaration

  • @@ -279,9 +279,9 @@

    Declaration

  • @@ -306,9 +306,9 @@

    Declaration

  • @@ -333,9 +333,9 @@

    Declaration

  • @@ -360,9 +360,9 @@

    Declaration

  • @@ -389,7 +389,7 @@

    Declaration

    diff --git a/docs/Structs/SirenLookupModel.html b/docs/Structs/SirenLookupModel.html index 16e627fd..4be7a899 100644 --- a/docs/Structs/SirenLookupModel.html +++ b/docs/Structs/SirenLookupModel.html @@ -161,7 +161,7 @@

    Declaration

    diff --git a/docs/Structs/SirenLookupModel/Results.html b/docs/Structs/SirenLookupModel/Results.html index fb1d7aa5..245d7b7a 100644 --- a/docs/Structs/SirenLookupModel/Results.html +++ b/docs/Structs/SirenLookupModel/Results.html @@ -241,7 +241,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes.html index 48c529f0..6dd105a4 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes.html @@ -34,13 +34,7 @@ Siren
  • - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -94,13 +136,6 @@

    Classes

    -
    - - - -

    Siren

    -
    -
    • @@ -115,7 +150,7 @@

      Siren

      -

      The Siren Class. A singleton that is initialized using the shared constant.

      +

      The Siren Class.

      See more
      @@ -132,10 +167,42 @@

      Declaration

    +
    +
      +
    • +
      + + + + SirenViewController + +
      +
      +
      +
      +
      +
      +

      UIViewController Extension for Siren

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class SirenViewController : UIViewController
      + +
      +
      +
      +
      +
    • +
    +
    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren.html index 66663cda..8441ed14 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren.html @@ -34,13 +34,7 @@ Siren - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -95,7 +137,7 @@

    Siren

    -

    The Siren Class. A singleton that is initialized using the shared constant.

    +

    The Siren Class.

    @@ -104,9 +146,9 @@

    Siren

  • @@ -114,14 +156,14 @@

    Siren

    -

    The error domain for all errors created by Siren.

    +

    Return results or errors obtained from performing a version check with Siren.

    Declaration

    Swift

    -
    public let SirenErrorDomain: String
    +
    public typealias ResultsHandler = (Results?, KnownError?) -> Void
    @@ -131,9 +173,9 @@

    Declaration

  • - - - delegate + + + shared
    @@ -141,15 +183,14 @@

    Declaration

    -

    The SirenDelegate variable, which should be set if you’d like to be notified of any of specific user interactions or API success/failures. -Also set this variable if you’d like to use custom UI for presesnting the update notification.

    +

    The Siren singleton. The main point of entry to the Siren library.

    Declaration

    Swift

    -
    public weak var delegate: SirenDelegate?
    +
    public static let shared: Siren
    @@ -170,7 +211,7 @@

    Declaration

    The debug flag, which is disabled by default. -When enabled, a stream of print() statements are logged to your console when a version check is performed.

    +When enabled, a stream of print() statements are logged to your console when a version check is performed.

    @@ -187,9 +228,9 @@

    Declaration

  • - - - alertType + + + apiManager
    @@ -197,44 +238,17 @@

    Declaration

    -

    Determines the type of alert that should be shown. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the App Store API that is +used to fetch the latest version of the app.

    -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var alertType: Siren.AlertType { get set }
    - -
    -
    -
    -
    -
  • -
  • -
    - - - - majorUpdateAlertType - -
    -
    -
    -
    -
    -
    -

    Determines the type of alert that should be shown for major version updates: A.b.c -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    Defaults to the US App Store.

    Declaration

    Swift

    -
    public lazy var majorUpdateAlertType: AlertType { get set }
    +
    public lazy var apiManager: APIManager { get set }
    @@ -244,9 +258,9 @@

    Declaration

  • @@ -254,16 +268,16 @@

    Declaration

    -

    Determines the type of alert that should be shown for minor version updates: a.B.c -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the update alert’s string localization and tint color.

    + +

    Defaults the string’s lange localization to the user’s device localization.

    Declaration

    Swift

    -
    public lazy var minorUpdateAlertType: AlertType { get set }
    +
    public lazy var presentationManager: PresentationManager { get set }
    @@ -273,9 +287,9 @@

    Declaration

  • @@ -283,16 +297,21 @@

    Declaration

    -

    Determines the type of alert that should be shown for minor patch updates: a.b.C -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The manager that controls the type of alert that should be displayed +and how often an alert should be displayed dpeneding on the type +of update that is available relative to the installed version of the app +(e.g., different rules for major, minor, patch and revision updated can be used).

    + +

    Defaults to performing a version check once a day with an alert that allows +the user to skip updating the app until the next time the app becomes active or +skipping the update all together until another version is released.

    Declaration

    Swift

    -
    public lazy var patchUpdateAlertType: AlertType { get set }
    +
    public lazy var rulesManager: RulesManager { get set }
    @@ -302,9 +321,9 @@

    Declaration

  • @@ -312,16 +331,14 @@

    Declaration

    -

    Determines the type of alert that should be shown for revision updates: a.b.c.D -Defaults to Siren.AlertType.option. -See the Siren.AlertType enum for full details.

    +

    The current installed version of your app.

    Declaration

    Swift

    -
    public lazy var revisionUpdateAlertType: AlertType { get set }
    +
    lazy var currentInstalledVersion: String? { get set }
    @@ -331,9 +348,9 @@

    Declaration

  • @@ -341,15 +358,14 @@

    Declaration

    -

    The name of your app. -By default, it’s set to the name of the app that’s stored in your plist.

    +

    The retained NotificationCenter observer that listens for UIApplication.didBecomeActiveNotification notifications.

    Declaration

    Swift

    -
    public lazy var appName: String { get set }
    +
    var didBecomeActiveObserver: NSObjectProtocol?
    @@ -359,9 +375,9 @@

    Declaration

  • @@ -369,15 +385,14 @@

    Declaration

    -

    Overrides all the Strings to which Siren defaults. -Defaults to the values defined in SirenAlertMessaging.Constants

    +

    The last date that an alert was presented to the user.

    Declaration

    Swift

    -
    public var alertMessaging: SirenAlertMessaging
    +
    private var alertPresentationDate: Date?
    @@ -387,9 +402,9 @@

    Declaration

  • - - - countryCode + + + appID
    @@ -397,16 +412,14 @@

    Declaration

    -

    The region or country of an App Store in which your app is available. -By default, all version checks are performed against the US App Store. -If your app is not available in the US App Store, set it to the identifier of at least one App Store within which it is available.

    +

    The App Store’s unique identifier for an app.

    Declaration

    Swift

    -
    public var countryCode: String?
    +
    private var appID: Int?
    @@ -416,9 +429,9 @@

    Declaration

  • @@ -426,15 +439,14 @@

    Declaration

    -

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert. -See the Siren.LanguageType enum for more details.

    +

    The completion handler used to return the results or errors returned by Siren.

    Declaration

    Swift

    -
    public var forceLanguageLocalization: Siren.LanguageType?
    +
    private var resultsHandler: Siren.ResultsHandler?
    @@ -444,9 +456,9 @@

    Declaration

  • @@ -454,26 +466,37 @@

    Declaration

    -

    Overrides the tint color for UIAlertController.

    +

    The initialization method.

    Declaration

    Swift

    -
    public var alertControllerTintColor: UIColor?
    +
    private override init()
  • + +
    +
    + +
    • @@ -481,27 +504,44 @@

      Declaration

      -

      When this is set, the alert will only show up if the current version has already been released for X days. -Defaults to 1 day to avoid an issue where Apple updates the JSON faster than the app binary propogates to the App Store.

      - +

      Declaration

      Swift

      -
      public var showAlertAfterCurrentVersionHasBeenReleasedForDays: Int
      +
      func wail(completion handler: ResultsHandler? = nil)
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      +
      +
      +
    • @@ -509,26 +549,40 @@

      Declaration

      -

      The current version of your app that is available for download on the App Store

      +

      Launches the AppStore in two situations when the user clicked the Update button in the UIAlertController modal.

      + +

      This function is marked public as a convenience for those developers who decide to build a custom alert modal +instead of using Siren’s prebuilt update alert.

      Declaration

      Swift

      -
      public internal(set) var currentAppStoreVersion: String?
      +
      func launchAppStore()
    • +
    +
    +
    + +
    • @@ -536,14 +590,14 @@

      Declaration

      -

      The App’s Singleton

      +

      Initiates the uni-directional version checking flow.

      Declaration

      Swift

      -
      public static let shared: Siren
      +
      func performVersionCheck()
      @@ -553,9 +607,9 @@

      Declaration

    • @@ -563,16 +617,16 @@

      Declaration

      -

      Checks the currently installed version of your app against the App Store. -The default check is against the US App Store, but if your app is not listed in the US, -you should set the countryCode property before calling this method. Please refer to the countryCode property for more information.

      +

      Validates the parsed and mapped iTunes Lookup Model +to guarantee all the relevant data was returned before +attempting to present an alert.

      Declaration

      Swift

      -
      public func checkVersion(checkType: VersionCheckType)
      +
      func validate(model: LookupModel)
      @@ -583,12 +637,12 @@

      Parameters

      - checkType + model
      -

      The frequency in days in which you want a check to be performed. Please refer to the Siren.VersionCheckType enum for more details.

      +

      The iTunes Lookup Model.

      @@ -601,9 +655,9 @@

      Parameters

    • @@ -611,60 +665,48 @@

      Parameters

      -

      Launches the AppStore in two situations:

      - -
        -
      • User clicked the Update button in the UIAlertController modal.
      • -
      • Developer built a custom alert modal and needs to be able to call this function when the user chooses to update the app in the aforementioned custom modal.
      • -
      +

      Determines if the update alert can be presented based on the +rules set in the RulesManager and the the skip version settings.

      Declaration

      Swift

      -
      public func launchAppStore()
      +
      func determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion currentAppStoreVersion: String, andLookupModel model: LookupModel)
      -
      -
      -
    • -
    -
    -
    - -
      -
    • -
      - - - - AlertType - -
      -
      -
      -
      -
      -
      -

      Determines the type of alert to present after a successful version check has been performed.

      - - See more -
      -
      -

      Declaration

      -
      -

      Swift

      -
      enum AlertType
      - -
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + currentAppStoreVersion + + +
      +

      The curren version of the app in the App Store.

      +
      +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      @@ -672,9 +714,9 @@

      Declaration

    • @@ -682,27 +724,85 @@

      Declaration

      -

      Determines the frequency in which the the version check is performed and the user is prompted to update the app.

      +

      Presents the update alert to the end user. +Upon tapping a value on the alert view, a completion handler will return all relevant metadata to the app.

      - See more

      Declaration

      Swift

      -
      enum VersionCheckType : Int
      +
      func presentAlert(withRules rules: Rules,
      +                  forCurrentAppStoreVersion currentAppStoreVersion: String,
      +                  model: LookupModel,
      +                  andUpdateType updateType: RulesManager.UpdateType)
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + rules + + +
      +

      The rules for how to present the alert.

      +
      +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      + + updateType + + +
      +

      The type of update that is available based on the version found in the App Store.

      +
      +
      +
    • @@ -710,18 +810,15 @@

      Declaration

      -

      Determines the available languages in which the update message and alert button titles should appear.

      - -

      By default, the operating system’s default lanuage setting is used. However, you can force a specific language -by setting the forceLanguageLocalization property before calling checkVersion()

      +

      Add an observer that listens for app launching/relaunching +(e.g., calls to UIApplication‘s didBecomeActive function).

      - See more

      Declaration

      Swift

      -
      enum LanguageType : String
      +
      func addObservers()
      @@ -733,7 +830,7 @@

      Declaration

  • diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/AlertType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/AlertType.html index 414365b5..dac6a08f 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/AlertType.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/AlertType.html @@ -64,22 +64,22 @@ Structures
  • @@ -104,9 +104,9 @@

    AlertType

  • - + - force + force
    @@ -131,9 +131,9 @@

    Declaration

  • - + - option + option
    @@ -158,9 +158,9 @@

    Declaration

  • - + - skip + skip
    @@ -185,9 +185,9 @@

    Declaration

  • - + - none + none
    @@ -215,7 +215,7 @@

    Declaration

  • diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/LanguageType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/LanguageType.html index 0802a3cd..1c849a98 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/LanguageType.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/LanguageType.html @@ -64,22 +64,22 @@ Structures
  • @@ -107,9 +107,9 @@

    LanguageType

  • - + - arabic + arabic
    @@ -134,9 +134,9 @@

    Declaration

  • - + - armenian + armenian
    @@ -161,9 +161,9 @@

    Declaration

  • - + - basque + basque
    @@ -188,9 +188,9 @@

    Declaration

  • @@ -215,9 +215,9 @@

    Declaration

  • @@ -242,9 +242,9 @@

    Declaration

  • - + - croatian + croatian
    @@ -269,9 +269,9 @@

    Declaration

  • - + - czech + czech
    @@ -296,9 +296,9 @@

    Declaration

  • - + - danish + danish
    @@ -323,9 +323,9 @@

    Declaration

  • - + - dutch + dutch
    @@ -350,9 +350,9 @@

    Declaration

  • - + - english + english
    @@ -377,9 +377,9 @@

    Declaration

  • - + - estonian + estonian
    @@ -404,9 +404,9 @@

    Declaration

  • - + - finnish + finnish
    @@ -431,9 +431,9 @@

    Declaration

  • - + - french + french
    @@ -458,9 +458,9 @@

    Declaration

  • - + - german + german
    @@ -485,9 +485,9 @@

    Declaration

  • - + - greek + greek
    @@ -512,9 +512,9 @@

    Declaration

  • - + - hebrew + hebrew
    @@ -539,9 +539,9 @@

    Declaration

  • @@ -566,9 +566,9 @@

    Declaration

  • @@ -593,9 +593,9 @@

    Declaration

  • - + - italian + italian
    @@ -620,9 +620,9 @@

    Declaration

  • - + - japanese + japanese
    @@ -647,9 +647,9 @@

    Declaration

  • - + - korean + korean
    @@ -674,9 +674,9 @@

    Declaration

  • - + - latvian + latvian
    @@ -701,9 +701,9 @@

    Declaration

  • @@ -728,9 +728,9 @@

    Declaration

  • - + - malay + malay
    @@ -755,9 +755,9 @@

    Declaration

  • @@ -782,9 +782,9 @@

    Declaration

  • - + - persian + persian
    @@ -809,9 +809,9 @@

    Declaration

  • @@ -836,9 +836,9 @@

    Declaration

  • @@ -863,9 +863,9 @@

    Declaration

  • - + - polish + polish
    @@ -890,9 +890,9 @@

    Declaration

  • @@ -917,9 +917,9 @@

    Declaration

  • @@ -944,9 +944,9 @@

    Declaration

  • - + - russian + russian
    @@ -971,9 +971,9 @@

    Declaration

  • @@ -998,9 +998,9 @@

    Declaration

  • @@ -1025,9 +1025,9 @@

    Declaration

  • @@ -1052,9 +1052,9 @@

    Declaration

  • - + - spanish + spanish
    @@ -1079,9 +1079,9 @@

    Declaration

  • - + - swedish + swedish
    @@ -1106,9 +1106,9 @@

    Declaration

  • - + - thai + thai
    @@ -1133,9 +1133,9 @@

    Declaration

  • - + - turkish + turkish
    @@ -1160,9 +1160,9 @@

    Declaration

  • - + - urdu + urdu
    @@ -1187,9 +1187,9 @@

    Declaration

  • @@ -1214,9 +1214,9 @@

    Declaration

  • @@ -1243,7 +1243,7 @@

    Declaration

  • diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/VersionCheckType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/VersionCheckType.html index 5a289556..548a463d 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/VersionCheckType.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/Siren/VersionCheckType.html @@ -64,22 +64,22 @@ Structures
  • @@ -104,9 +104,9 @@

    VersionCheckType

  • @@ -131,9 +131,9 @@

    Declaration

  • - + - daily + daily
    @@ -158,9 +158,9 @@

    Declaration

  • - + - weekly + weekly
    @@ -187,7 +187,7 @@

    Declaration

  • diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/SirenViewController.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/SirenViewController.html new file mode 100644 index 00000000..543f954f --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Classes/SirenViewController.html @@ -0,0 +1,185 @@ + + + + SirenViewController Class Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    SirenViewController

    +
    +
    +
    final class SirenViewController : UIViewController
    + +
    +
    +

    UIViewController Extension for Siren

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      UIStatusBarStyle override.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      override var preferredStatusBarStyle: UIStatusBarStyle { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums.html index bcf77e18..5e6c536b 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums.html @@ -34,13 +34,7 @@ Siren
  • - -
  • @@ -48,15 +42,33 @@ Enumerations
  • @@ -64,22 +76,52 @@ Structures @@ -98,9 +140,9 @@

    Enumerations

  • - - - UpdateType + + + AlertAction
    @@ -108,26 +150,47 @@

    Enumerations

    -

    MARK - Siren UpdateType -UpdateType defines what kind of update is available. -It is used as parameter if user wants to use -custom alert to inform the user about an update.

    +

    The UIAlertController button that was pressed upon being presented an update alert.

    -
      -
    • major: Major release available: A.b.c.d
    • -
    • minor: Minor release available: a.B.c.d
    • -
    • patch: Patch release available: a.b.C.d
    • -
    • revision: Revision release available: a.b.c.D
    • -
    • unknown: No information available about the update.
    • -
    + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum AlertAction
    + +
    +
    +
    +
    +
  • + + +
    +
      +
    • +
      + + + + KnownError + +
      +
      +
      +
      +
      +
      +

      Enumerates all potentials errors that Siren can handle.

      - See more + See more

      Declaration

      Swift

      -
      public enum UpdateType : String
      +
      public enum KnownError : LocalizedError
      @@ -139,7 +202,7 @@

      Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/AlertAction.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/AlertAction.html new file mode 100644 index 00000000..df23cf7a --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/AlertAction.html @@ -0,0 +1,266 @@ + + + + AlertAction Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertAction

    +
    +
    +
    public enum AlertAction
    + +
    +
    +

    The UIAlertController button that was pressed upon being presented an update alert.

    + +
    +
    +
    +
      +
    • +
      + + + + appStore + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Update option, which took them to the app’s App Store page.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStore
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTime + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Next Time option, which dismissed the alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case nextTime
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      The user clicked on the Skip this version option, which dismissed the alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      (Default) The user never chose an option. This is returned when an error is thrown by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/KnownError.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/KnownError.html new file mode 100644 index 00000000..e60c3168 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/KnownError.html @@ -0,0 +1,563 @@ + + + + KnownError Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    KnownError

    +
    +
    +
    public enum KnownError : LocalizedError
    + +
    +
    +

    Enumerates all potentials errors that Siren can handle.

    + +
    +
    +
    +
      +
    • +
      + + + + appStoreAppIDFailure + +
      +
      +
      +
      +
      +
      +

      Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreAppIDFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalEmptyResults
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as an error was returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalFailure(underlyingError: Error?)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error parsing App Store JSON data.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreJSONParsingFailure(underlyingError: Error)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The version of iOS on the device is lower than that of the one required by the app verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionUnsupported
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store verson number as the JSON does not contain a version key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreVersionArrayFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The currentVersionReleaseDate key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case currentVersionReleaseDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malformedURL + +
      +
      +
      +
      +
      +
      +

      One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malformedURL
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + missingBundleID + +
      +
      +
      +
      +
      +
      +

      Please make sure that you have set a Bundle Identifier in your project.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case missingBundleID
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + noUpdateAvailable + +
      +
      +
      +
      +
      +
      +

      No new update available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case noUpdateAvailable
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + recentlyPrompted + +
      +
      +
      +
      +
      +
      +

      Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the UpdatePromptFrequency.immediately rule in RulesManager

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case recentlyPrompted
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case releasedTooSoon(daysSinceRelease: Int, releasedForDays: Int)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The user has opted to skip updating their current version of the app to the current App Store version.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skipVersionUpdate(installedVersion: String, appStoreVersion: String)
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localizedDescription + +
      +
      +
      +
      +
      +
      +

      The localized description for each error handled by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var localizedDescription: String { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + sirenError + +
      +
      +
      +
      +
      +
      +

      An easily identifiable prefix for all errors thrown by Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private static var sirenError: String { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/UpdateType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/UpdateType.html index 3a7b62d6..194d915c 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/UpdateType.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Enums/UpdateType.html @@ -64,22 +64,22 @@ Structures @@ -115,9 +115,9 @@

    UpdateType

  • - + - major + major
    @@ -142,9 +142,9 @@

    Declaration

  • - + - minor + minor
    @@ -169,9 +169,9 @@

    Declaration

  • - + - patch + patch
    @@ -196,9 +196,9 @@

    Declaration

  • - + - revision + revision
    @@ -223,9 +223,9 @@

    Declaration

  • - + - unknown + unknown
    @@ -252,7 +252,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 00000000..b3f816c0 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,272 @@ + + + + Extensions Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Extensions

    +

    The following extensions are available globally.

    + +
    +
    +
    +
      +
    • +
      + + + + Bundle + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class Bundle : NSObject
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Date + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      struct Date : ReferenceConvertible, Comparable, Equatable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + UIAlertController + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class UIAlertController : UIViewController
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + UserDefaults + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      class UserDefaults : NSObject
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle.html new file mode 100644 index 00000000..a200bd70 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle.html @@ -0,0 +1,433 @@ + + + + Bundle Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Bundle

    +
    +
    +
    class Bundle : NSObject
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      Constants used in the Bundle extension.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      struct Constants
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version() + +
      +
      +
      +
      +
      +
      +

      Fetches the current verison of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func version() -> String?
      + +
      +
      +
      +

      Return Value

      +

      The current installed version of the app.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Returns the localized string for a given default string.

      + +

      By default, the English language localization is used. +If the device’s localization is set to another locale, that local’s language is used if it’s supported by Siren. +If forcedLanguage is set to true, the chosen language is shown for all devices, irrespective of their device’s localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func localizedString(forKey key: String, andForceLocalization forcedLanguage: Localization.Language?) -> String
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + key + + +
      +

      The default string used to search the localization table for a specific translation.

      +
      +
      + + forcedLanguage + + +
      +

      Returns

      +
      +
      +
      +
      +

      Return Value

      +

      The localized string for a given key.

      +
      +
      +
      +
    • +
    • +
      + + + + bestMatchingAppName() + +
      +
      +
      +
      +
      +
      +

      The appropriate name for the app to be displayed in the update alert.

      + +

      Siren checks CFBundleDisplayName first. It then falls back to +to kCFBundleNameKey and ultimately to an empty string +if the aforementioned values are nil.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func bestMatchingAppName() -> String
      + +
      +
      +
      +

      Return Value

      +

      The name of the app.

      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + sirenBundlePath() + +
      +
      +
      +
      +
      +
      +

      The path to Siren’s localization Bundle.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func sirenBundlePath() -> String?
      + +
      +
      +
      +

      Return Value

      +

      The bundle’s path or nil.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The path for a particular language localizationin Siren’s localization Bundle.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func sirenForcedBundlePath(forceLanguageLocalization: Localization.Language) -> String?
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + forceLanguageLocalization + + +
      +

      The language localization that should be searched for in Siren’s localization bundle.

      +
      +
      +
      +
      +

      Return Value

      +

      The path to the forced language localization.

      +
      +
      +
      +
    • +
    • +
      + + + + deviceLanguage() + +
      +
      +
      +
      +
      +
      +

      The user’s preferred language based on their device’s localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      final class func deviceLanguage() -> Localization.Language?
      + +
      +
      +
      +

      Return Value

      +

      The user’s preferred language.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle/Constants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle/Constants.html new file mode 100644 index 00000000..744910b9 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Bundle/Constants.html @@ -0,0 +1,320 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    struct Constants
    + +
    +
    +

    Constants used in the Bundle extension.

    + +
    +
    +
    +
      +
    • +
      + + + + bundleExtension + +
      +
      +
      +
      +
      +
      +

      Constant for the .bundle file extension.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let bundleExtension: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + displayName + +
      +
      +
      +
      +
      +
      +

      Constant for CFBundleDisplayName.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let displayName: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + englishLocalization + +
      +
      +
      +
      +
      +
      +

      Constant for the default US English localization.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let englishLocalization: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + projectExtension + +
      +
      +
      +
      +
      +
      +

      Constant for the project file extension.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let projectExtension: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + shortVersionString + +
      +
      +
      +
      +
      +
      +

      Constant for CFBundleShortVersionString.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let shortVersionString: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + table + +
      +
      +
      +
      +
      +
      +

      Constant for the localization table.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let table: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Date.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Date.html new file mode 100644 index 00000000..c827524a --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/Date.html @@ -0,0 +1,257 @@ + + + + Date Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Date

    +
    +
    +
    struct Date : ReferenceConvertible, Comparable, Equatable
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + days(since:) + +
      +
      +
      +
      +
      +
      +

      The amount of days passed from a specific source date.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func days(since date: Date) -> Int
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + date + + +
      +

      The source date.

      +
      +
      +
      +
      +

      Return Value

      +

      The amount of days passed since the source date.

      +
      +
      +
      +
    • +
    • +
      + + + + days(since:) + +
      +
      +
      +
      +
      +
      +

      The amount of days passed from a specific source date string.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func days(since dateString: String) -> Int?
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + dateString + + +
      +

      The source date string.

      +
      +
      +
      +
      +

      Return Value

      +

      The amount of days passed since the source date.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UIAlertController.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UIAlertController.html new file mode 100644 index 00000000..41651dd0 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UIAlertController.html @@ -0,0 +1,249 @@ + + + + UIAlertController Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UIAlertController

    +
    +
    +
    class UIAlertController : UIViewController
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + show(window:) + +
      +
      +
      +
      +
      +
      +

      Presents Siren’s UIAlertController in a new UIWindow.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func show(window: UIWindow)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + window + + +
      +

      The UIWindow that should reference Siren’s UIAlertController.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + hide(window:) + +
      +
      +
      +
      +
      +
      +

      Hides Siren’s UIAlertController within a given window.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func hide(window: UIWindow)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + window + + +
      +

      The UIWindow that references Siren’s UIAlertController.

      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults.html new file mode 100644 index 00000000..1c64d3cd --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults.html @@ -0,0 +1,266 @@ + + + + UserDefaults Extension Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UserDefaults

    +
    +
    +
    class UserDefaults : NSObject
    + +
    +
    + +
    +
    +
    +
      +
    • +
      + + + + SirenKeys + +
      +
      +
      +
      +
      +
      +

      Siren-specific UserDefaults Keys

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum SirenKeys : String
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around performing a version check on a subsequent launch.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var shouldPerformVersionCheckOnSubsequentLaunch: Bool { get set }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + storedSkippedVersion + +
      +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around storing a version that the user wants to skip updating.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var storedSkippedVersion: String? { get set }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertPresentationDate + +
      +
      +
      +
      +
      +
      +

      Sets and Gets a UserDefault around the last time the user was presented a version update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static var alertPresentationDate: Date? { get set }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults/SirenKeys.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults/SirenKeys.html new file mode 100644 index 00000000..6983054f --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Extensions/UserDefaults/SirenKeys.html @@ -0,0 +1,240 @@ + + + + SirenKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    SirenKeys

    +
    +
    +
    private enum SirenKeys : String
    + +
    +
    +

    Siren-specific UserDefaults Keys

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Key that notifies Siren to perform a version check and present +the Siren alert the next time the user launches the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case PerformVersionCheckOnSubsequentLaunch
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Key that stores the timestamp of the last version check.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case StoredVersionCheckDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + StoredSkippedVersion + +
      +
      +
      +
      +
      +
      +

      Key that stores the version that a user decided to skip.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case StoredSkippedVersion
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols.html index ccb40a40..17d6198c 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols.html @@ -33,23 +33,6 @@
  • - - - - - - @@ -135,7 +136,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols/SirenDelegate.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols/SirenDelegate.html index edf9991e..59df3c7a 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols/SirenDelegate.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Protocols/SirenDelegate.html @@ -33,23 +33,6 @@ - - - - - - @@ -104,9 +105,9 @@

    SirenDelegate

  • - + - sirenDidDetectNewVersionWithoutAlert(title:message:updateType:) + sirenDidDetectNewVersionWithoutAlert(title:message:updateType:) Default implementation @@ -128,7 +129,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: UpdateType)
    +
    func sirenDidDetectNewVersionWithoutAlert(title: String, message: String, updateType: Constants.UpdateType)
    @@ -138,9 +139,9 @@

    Declaration

  • - + - sirenDidFailVersionCheck(error:) + sirenDidFailVersionCheck(error:) Default implementation @@ -178,9 +179,9 @@

    Declaration

  • - + - sirenDidShowUpdateDialog(alertType:) + sirenDidShowUpdateDialog(alertType:) Default implementation @@ -202,7 +203,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenDidShowUpdateDialog(alertType: Siren.AlertType)
    +
    func sirenDidShowUpdateDialog(alertType: Constants.AlertType)
    @@ -265,9 +266,9 @@

    Declaration

  • - + - sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:) + sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:) Default implementation @@ -289,7 +290,7 @@

    Default Implementation

    Declaration

    Swift

    -
    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel)
    +
    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: LookupModel)
    @@ -422,7 +423,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs.html index e8b05e98..c0ef5159 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs.html @@ -34,13 +34,7 @@ Siren
  • - - @@ -48,15 +42,33 @@ Enumerations @@ -64,22 +76,52 @@ Structures @@ -94,20 +136,13 @@

    Structures

    -
    • @@ -115,22 +150,207 @@

      Siren Alert Messaging Customization

      -

      Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

      -
      -

      Warning

      - Overriding any of these keys will result in the loss of the built-in internationalization that Siren provides. +

      APIManager for Siren

      -
      + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct APIManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + PresentationManager + +
      +
      +
      +
      +
      +
      +

      PresentationManager for Siren

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct PresentationManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + RulesManager + +
      +
      +
      +
      +
      +
      +

      RulesManager for Siren

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct RulesManager
      -

      As SirenAlertMessaging is a Struct, one or more keys can be modified. Overriding only one string will result in the other keys retaining their default (and internationalizable) values.

      +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + AlertConstants + +
      +
      +
      +
      +
      +
      +

      The default constants used for the update alert’s messaging.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct AlertConstants
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Localization + +
      +
      +
      +
      +
      +
      +

      Localization information and strings for Siren.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Localization
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + LookupModel + +
      +
      +
      +
      +
      +
      +

      Model representing a selection of results from the iTunes Lookup API.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct LookupModel : Decodable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + Results + +
      +
      +
      +
      +
      +
      +

      The relevant metadata returned from Siren upon completing a successful version check.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenAlertMessaging
      +
      public struct Results
      @@ -140,20 +360,13 @@

      Declaration

    -
    • - - - SirenLookupModel + + + Rules
      @@ -161,15 +374,15 @@

      Model representing a selection of results from the iTun
      -

      MARK: Siren extension used to parse and map the iTunes JSON results into a model represented in Swift.

      +

      Alert Presentation Rules for Siren.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenLookupModel : Decodable
      +
      public struct Rules
      @@ -179,20 +392,13 @@

      Declaration

    -
    • - - - SirenError + + + DataParser
      @@ -200,15 +406,15 @@

      Siren Error Handling

      -

      Data structure used to build Siren specific Errors.

      +

      Version parsing functions for Siren.

      - See more + See more

      Declaration

      Swift

      -
      public struct SirenError : LocalizedError
      +
      struct DataParser
      @@ -220,7 +426,7 @@

      Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager.html new file mode 100644 index 00000000..57385729 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager.html @@ -0,0 +1,494 @@ + + + + APIManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    APIManager

    +
    +
    +
    public struct APIManager
    + +
    +
    +

    APIManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      Constants used in the APIManager.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private struct Constants
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + CompletionHandler + +
      +
      +
      +
      +
      +
      +

      Return results or errors obtained from performing a version check with Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      typealias CompletionHandler = (LookupModel?, KnownError?) -> Void
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + countryCode + +
      +
      +
      +
      +
      +
      +

      The region or country of an App Store in which the app is available. +By default, all version check requests are performed against the US App Store. +If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.

      + +

      List of country codes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let countryCode: String?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + init(countryCode:) + +
      +
      +
      +
      +
      +
      +

      Initializes APIManager to the region or country of an App Store in which the app is available. +By default, all version check requests are performed against the US App Store. +If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.

      + +

      List of country codes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(countryCode: String? = nil)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + countryCode + + +
      +

      The country code for the App Store in which the app is availabe. Defaults to nil (e.g., the US App Store)

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default APIManager.

      + +

      The version check is performed against the US App Store.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: APIManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Creates and performs a URLRequest against the iTunes Lookup API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func performVersionCheckRequest(completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler for the iTunes Lookup API request.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Parses and maps the the results from the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func processVersionCheckResults(withData data: Data?,
      +                                        response: URLResponse?,
      +                                        error: Error?,
      +                                        completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + +
      + + data + + +
      +

      The JSON data returned from the request.

      +
      +
      + + response + + +
      +

      The response metadata returned from the request.

      +
      +
      + + error + + +
      +

      The error returned from the request.

      +
      +
      + + handler + + +
      +

      The completion handler to call once the results of the request has been processed.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + makeITunesURL() + +
      +
      +
      +
      +
      +
      +

      Creates the URL that points to the iTunes Lookup API.

      +
      +

      Throws

      + An error if the URL cannot be created. + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func makeITunesURL() throws -> URL
      + +
      +
      +
      +

      Return Value

      +

      The iTunes Lookup API URL.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager/Constants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager/Constants.html new file mode 100644 index 00000000..645afd45 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/APIManager/Constants.html @@ -0,0 +1,212 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    private struct Constants
    + +
    +
    +

    Constants used in the APIManager.

    + +
    +
    +
    +
      +
    • +
      + + + + bundleID + +
      +
      +
      +
      +
      +
      +

      Constant for the bundleId parameter in the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let bundleID: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + country + +
      +
      +
      +
      +
      +
      +

      Constant for the country parameter in the iTunes Lookup API request.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static let country: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertConstants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertConstants.html new file mode 100644 index 00000000..2717d6dc --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertConstants.html @@ -0,0 +1,293 @@ + + + + AlertConstants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertConstants

    +
    +
    +
    public struct AlertConstants
    + +
    +
    +

    The default constants used for the update alert’s messaging.

    + +
    +
    +
    +
      +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that there is an app update available

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertMessage: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The alert title which defaults to Update Available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user should be prompted to update next time the app launches.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let nextTimeButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that the the user wants to skip this verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let skipButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user would like to update the app right away.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let updateButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging.html new file mode 100644 index 00000000..4984c1c1 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging.html @@ -0,0 +1,250 @@ + + + + AlertMessaging Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertMessaging

    +
    +
    +
    public struct AlertMessaging
    + +
    +
    +

    Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

    +
    +

    Warning

    + Overriding any of these keys will result in the loss of the built-in internationalization that Siren provides. + +
    + +

    As SirenAlertMessaging is a Struct, one or more keys can be modified. Overriding only one string will result in the other keys retaining their default (and internationalizable) values.

    + +
    +
    +
    +
      +
    • +
      + + + + Constants + +
      +
      +
      +
      +
      +
      +

      The default constants used for the alert messaging.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Constants
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The public initializer

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(updateTitle title: NSAttributedString  = Constants.alertTitle,
      +            updateMessage message: NSAttributedString  = Constants.alertMessage,
      +            updateButtonMessage: NSAttributedString  = Constants.updateButtonTitle,
      +            nextTimeButtonMessage: NSAttributedString  = Constants.nextTimeButtonTitle,
      +            skipVersionButtonMessage: NSAttributedString  = Constants.skipButtonTitle)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + +
      + + title + + +
      +

      The title field of the UIAlertController.

      +
      +
      + + message + + +
      +

      The message field of the UIAlertController.

      +
      +
      + + updateButtonMessage + + +
      +

      The title field of the Update Button UIAlertAction.

      +
      +
      + + nextTimeButtonMessage + + +
      +

      The title field of the Next Time Button UIAlertAction.

      +
      +
      + + skipVersionButtonMessage + + +
      +

      The title field of the Skip Button UIAlertAction.

      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging/Constants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging/Constants.html new file mode 100644 index 00000000..5b9d5c7f --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/AlertMessaging/Constants.html @@ -0,0 +1,252 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    public struct Constants
    + +
    +
    +

    The default constants used for the alert messaging.

    + +
    +
    +
    +
      +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that there is an app update available

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertMessage: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The alert title which defaults to Update Available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let alertTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user should be prompted to update next time the app launches.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let nextTimeButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The text that conveys the message that the the user wants to skip this verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let skipButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The button text that conveys the message that the user would like to update the app right away.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let updateButtonTitle: NSAttributedString
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError.html new file mode 100644 index 00000000..bce35f56 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError.html @@ -0,0 +1,158 @@ + + + + CapturedError Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CapturedError

    +
    +
    +
    public struct CapturedError : LocalizedError
    + +
    +
    +

    Siren extension dealing with Siren-specific errors.

    + +
    +
    +
    +
      +
    • +
      + + + + Known + +
      +
      +
      +
      +
      +
      +

      Enumerates all potentials errors that Siren can handle.

      + +
        +
      • appStoreAppIDFailure: Error retrieving trackId as the JSON does not contain a ‘trackId’ key.
      • +
      • appStoreDataRetrievalFailure: Error retrieving App Store data as an error was returned.
      • +
      • appStoreJSONParsingFailure: Error parsing App Store JSON data.
      • +
      • appStoreDataRetrievalEmptyResults: Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.
      • +
      • appStoreOSVersionNumberFailure: Error retrieving iOS version number as there was no data returned.
      • +
      • appStoreOSVersionUnsupported: The version of iOS on the device is lower than that of the one required by the app verison update.
      • +
      • appStoreVersionArrayFailure: Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.
      • +
      • malformedURL: The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
      • +
      • noUpdateAvailable: No new update available.
      • +
      • recentlyCheckedAlready: Not checking the version, because it was already checked recently.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum Known : Error
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError/Known.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError/Known.html new file mode 100644 index 00000000..dc1c8aaa --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/CapturedError/Known.html @@ -0,0 +1,400 @@ + + + + Known Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Known

    +
    +
    +
    public enum Known : Error
    + +
    +
    +

    Enumerates all potentials errors that Siren can handle.

    + +
      +
    • appStoreAppIDFailure: Error retrieving trackId as the JSON does not contain a ‘trackId’ key.
    • +
    • appStoreDataRetrievalFailure: Error retrieving App Store data as an error was returned.
    • +
    • appStoreJSONParsingFailure: Error parsing App Store JSON data.
    • +
    • appStoreDataRetrievalEmptyResults: Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.
    • +
    • appStoreOSVersionNumberFailure: Error retrieving iOS version number as there was no data returned.
    • +
    • appStoreOSVersionUnsupported: The version of iOS on the device is lower than that of the one required by the app verison update.
    • +
    • appStoreVersionArrayFailure: Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.
    • +
    • malformedURL: The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
    • +
    • noUpdateAvailable: No new update available.
    • +
    • recentlyCheckedAlready: Not checking the version, because it was already checked recently.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + appStoreAppIDFailure + +
      +
      +
      +
      +
      +
      +

      Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreAppIDFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as an error was returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalFailure(underlyingError: Error?)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error parsing App Store JSON data.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreJSONParsingFailure(underlyingError: Error)
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreDataRetrievalEmptyResults
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving iOS version number as there was no data returned.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionNumberFailure
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The version of iOS on the device is lower than that of the one required by the app verison update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreOSVersionUnsupported
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appStoreVersionArrayFailure
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malformedURL + +
      +
      +
      +
      +
      +
      +

      The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malformedURL
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + noUpdateAvailable + +
      +
      +
      +
      +
      +
      +

      No new update available.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case noUpdateAvailable
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Not checking the version, because it was already checked recently.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case recentlyCheckedAlready
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants.html new file mode 100644 index 00000000..d85e5cfa --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants.html @@ -0,0 +1,211 @@ + + + + Constants Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Constants

    +
    +
    +
    public struct Constants
    + +
    +
    +

    Lists all enumerated types that are used to configure the library.

    + +
    +
    +
    +
      +
    • +
      + + + + AlertType + +
      +
      +
      +
      +
      +
      +

      Determines the type of alert to present after a successful version check has been performed.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + UpdateType + +
      +
      +
      +
      +
      +
      +

      UpdateType defines what kind of update is available. +It is used as a parameter if the user wants to use +a custom alert to inform the user about an update.

      + +
        +
      • major: Major release available: A.b.c.d
      • +
      • minor: Minor release available: a.B.c.d
      • +
      • patch: Patch release available: a.b.C.d
      • +
      • revision: Revision release available: a.b.c.D
      • +
      • unknown: No information available about the update.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdateType : String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + VersionCheckFrequency + +
      +
      +
      +
      +
      +
      +

      Determines the frequency in which the the version check is performed and the user is prompted to update the app.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum VersionCheckFrequency : Int
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/AlertType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/AlertType.html new file mode 100644 index 00000000..a24bea17 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/AlertType.html @@ -0,0 +1,226 @@ + + + + AlertType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertType

    +
    +
    +
    public enum AlertType
    + +
    +
    +

    Determines the type of alert to present after a successful version check has been performed.

    + +
    +
    +
    +
      +
    • +
      + + + + force + +
      +
      +
      +
      +
      +
      +

      Forces user to update your app (1 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case force
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + option + +
      +
      +
      +
      +
      +
      +

      (DEFAULT) Presents user with option to update app now or at next launch (2 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case option
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + none + +
      +
      +
      +
      +
      +
      +

      Doesn’t show the alert, but instead returns a localized message +for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case none
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/UpdateType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/UpdateType.html new file mode 100644 index 00000000..7633d0ac --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/UpdateType.html @@ -0,0 +1,262 @@ + + + + UpdateType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdateType

    +
    +
    +
    public enum UpdateType : String
    + +
    +
    +

    UpdateType defines what kind of update is available. +It is used as a parameter if the user wants to use +a custom alert to inform the user about an update.

    + +
      +
    • major: Major release available: A.b.c.d
    • +
    • minor: Minor release available: a.B.c.d
    • +
    • patch: Patch release available: a.b.C.d
    • +
    • revision: Revision release available: a.b.c.D
    • +
    • unknown: No information available about the update.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + major + +
      +
      +
      +
      +
      +
      +

      Major release available: A.b.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case major
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minor + +
      +
      +
      +
      +
      +
      +

      Minor release available: a.B.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minor
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patch + +
      +
      +
      +
      +
      +
      +

      Patch release available: a.b.C.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case patch
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revision + +
      +
      +
      +
      +
      +
      +

      Revision release available: a.b.c.D

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case revision
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      No information available about the update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/VersionCheckFrequency.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/VersionCheckFrequency.html new file mode 100644 index 00000000..c1c179fc --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Constants/VersionCheckFrequency.html @@ -0,0 +1,198 @@ + + + + VersionCheckFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    VersionCheckFrequency

    +
    +
    +
    public enum VersionCheckFrequency : Int
    + +
    +
    +

    Determines the frequency in which the the version check is performed and the user is prompted to update the app.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/DataParser.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/DataParser.html new file mode 100644 index 00000000..739b616c --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/DataParser.html @@ -0,0 +1,385 @@ + + + + DataParser Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    DataParser

    +
    +
    +
    struct DataParser
    + +
    +
    +

    Version parsing functions for Siren.

    + +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Checks to see if the App Store version of the app is newer than the installed version.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func isAppStoreVersionNewer(installedVersion: String?, appStoreVersion: String?) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + installedVersion + + +
      +

      The installed version of the app.

      +
      +
      + + appStoreVersion + + +
      +

      The App Store version of the app.

      +
      +
      +
      +
      +

      Return Value

      +

      true if the App Store version is newer. Otherwise, false.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Validates that the latest version in the App Store is compatible with the device’s current version of iOS.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func isUpdateCompatibleWithDeviceOS(for model: LookupModel) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + model + + +
      +

      The iTunes Lookup Model.

      +
      +
      +
      +
      +

      Return Value

      +

      true if the latest version is compatible with the device’s current version of iOS. Otherwise, false.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The type of update that is returned from the API in relation to the verison of the app that is installed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static func parseForUpdate(forInstalledVersion installedVersion: String?,
      +                           andAppStoreVersion appStoreVersion: String?) -> RulesManager.UpdateType
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + installedVersion + + +
      +

      The installed version of the app.

      +
      +
      + + appStoreVersion + + +
      +

      The App Store version of the app.

      +
      +
      +
      +
      +

      Return Value

      +

      The type of update in relation to the verison of the app that is installed.

      +
      +
      +
      +
    • +
    • +
      + + + + split(version:) + +
      +
      +
      +
      +
      +
      +

      Splits a version-formatted String into an[Int]`.

      + +

      Converts "a.b.c.d" into [a, b, c, d].

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private static func split(version: String) -> [Int]
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + version + + +
      +

      The version formatted String.

      +
      +
      +
      +
      +

      Return Value

      +

      An array of integers representing a version of the app.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization.html new file mode 100644 index 00000000..78a6c884 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization.html @@ -0,0 +1,458 @@ + + + + Localization Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Localization

    +
    +
    +
    public struct Localization
    + +
    +
    +

    Localization information and strings for Siren.

    + +
    +
    +
    +
      +
    • +
      + + + + Language + +
      +
      +
      +
      +
      +
      +

      Determines the available languages in which the update message and alert button titles should appear.

      + +

      By default, the operating system’s default lanuage setting is used. However, you can force a specific language +by setting the forceLanguageLocalization property before calling checkVersion()

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum Language : String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + appName + +
      +
      +
      +
      +
      +
      +

      The name of the app as defined by the Info.plist.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var appName: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + forceLanguage + +
      +
      +
      +
      +
      +
      +

      Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.

      + +

      See the Siren.Localization.Language enum for more details.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private let forceLanguage: Language?
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializes

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      init(appName: String?, andForceLanguageLocalization forceLanguage: Language?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + appName + + +
      +

      Overrides the default name of the app. This is optional and defaults to the app that is defined in the Info.plist.

      +
      +
      + + forceLanguage + + +
      +

      The language the alert to which the alert should be set. If nil, it falls back to the device’s preferred locale.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The localized string for the UIAlertController‘s message field. .

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func alertMessage(forCurrentAppStoreVersion currentAppStoreVersion: String) -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the update message.

      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the UIAlertController‘s title field. .

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func alertTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Update Available.

      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Next time UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func nextTimeButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Next time.

      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Skip this version UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func skipButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Skip this version.

      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle() + +
      +
      +
      +
      +
      +
      +

      The localized string for the Update UIAlertAction.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func updateButtonTitle() -> String
      + +
      +
      +
      +

      Return Value

      +

      A localized string for the phrase Update.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization/Language.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization/Language.html new file mode 100644 index 00000000..a1e50087 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Localization/Language.html @@ -0,0 +1,1295 @@ + + + + Language Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Language

    +
    +
    +
    public enum Language : String
    + +
    +
    +

    Determines the available languages in which the update message and alert button titles should appear.

    + +

    By default, the operating system’s default lanuage setting is used. However, you can force a specific language +by setting the forceLanguageLocalization property before calling checkVersion()

    + +
    +
    +
    +
      +
    • +
      + + + + arabic + +
      +
      +
      +
      +
      +
      +

      Arabic Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case arabic = "ar"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + armenian + +
      +
      +
      +
      +
      +
      +

      Armenian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case armenian = "hy"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + basque + +
      +
      +
      +
      +
      +
      +

      Basque Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case basque = "eu"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + chineseSimplified + +
      +
      +
      +
      +
      +
      +

      Simplified Chinese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case chineseSimplified = "zh-Hans"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + chineseTraditional + +
      +
      +
      +
      +
      +
      +

      Traditional Chinese Localization Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case chineseTraditional = "zh-Hant"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + croatian + +
      +
      +
      +
      +
      +
      +

      Croatian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case croatian = "hr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + czech + +
      +
      +
      +
      +
      +
      +

      Czech Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case czech = "cs"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + danish + +
      +
      +
      +
      +
      +
      +

      Danish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case danish = "da"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + dutch + +
      +
      +
      +
      +
      +
      +

      Dutch Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case dutch = "nl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + english + +
      +
      +
      +
      +
      +
      +

      English Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case english = "en"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + estonian + +
      +
      +
      +
      +
      +
      +

      Estonian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case estonian = "et"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + finnish + +
      +
      +
      +
      +
      +
      +

      Finnish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case finnish = "fi"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + french + +
      +
      +
      +
      +
      +
      +

      French Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case french = "fr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + german + +
      +
      +
      +
      +
      +
      +

      German Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case german = "de"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + greek + +
      +
      +
      +
      +
      +
      +

      Greek Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case greek = "el"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + hebrew + +
      +
      +
      +
      +
      +
      +

      Hebrew Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case hebrew = "he"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + hungarian + +
      +
      +
      +
      +
      +
      +

      Hungarian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case hungarian = "hu"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + indonesian + +
      +
      +
      +
      +
      +
      +

      Indonesian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case indonesian = "id"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + italian + +
      +
      +
      +
      +
      +
      +

      Italian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case italian = "it"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + japanese + +
      +
      +
      +
      +
      +
      +

      Japanese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case japanese = "ja"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + korean + +
      +
      +
      +
      +
      +
      +

      Korean Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case korean = "ko"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + latvian + +
      +
      +
      +
      +
      +
      +

      Latvian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case latvian = "lv"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + lithuanian + +
      +
      +
      +
      +
      +
      +

      Lithuanian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case lithuanian = "lt"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + malay + +
      +
      +
      +
      +
      +
      +

      Malay Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case malay = "ms"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + norwegian + +
      +
      +
      +
      +
      +
      +

      Norwegian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case norwegian = "nb-NO"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persian + +
      +
      +
      +
      +
      +
      +

      Persian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persian = "fa"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persianAfghanistan + +
      +
      +
      +
      +
      +
      +

      Persian (Afghanistan) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persianAfghanistan = "fa-AF"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persianIran + +
      +
      +
      +
      +
      +
      +

      Persian (Iran) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case persianIran = "fa-IR"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + polish + +
      +
      +
      +
      +
      +
      +

      Polish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case polish = "pl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + portugueseBrazil + +
      +
      +
      +
      +
      +
      +

      Brazilian Portuguese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case portugueseBrazil = "pt"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + portuguesePortugal + +
      +
      +
      +
      +
      +
      +

      Portugal’s Portuguese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case portuguesePortugal = "pt-PT"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + russian + +
      +
      +
      +
      +
      +
      +

      Russian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case russian = "ru"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + serbianCyrillic + +
      +
      +
      +
      +
      +
      +

      Serbian (Cyrillic) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case serbianCyrillic = "sr-Cyrl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + serbianLatin + +
      +
      +
      +
      +
      +
      +

      Serbian (Latin) Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case serbianLatin = "sr-Latn"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + slovenian + +
      +
      +
      +
      +
      +
      +

      Slovenian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case slovenian = "sl"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + spanish + +
      +
      +
      +
      +
      +
      +

      Spanish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case spanish = "es"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + swedish + +
      +
      +
      +
      +
      +
      +

      Swedish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case swedish = "sv"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + thai + +
      +
      +
      +
      +
      +
      +

      Thai Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case thai = "th"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + turkish + +
      +
      +
      +
      +
      +
      +

      Turkish Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case turkish = "tr"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + urdu + +
      +
      +
      +
      +
      +
      +

      Urdu Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case urdu = "ur"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + ukrainian + +
      +
      +
      +
      +
      +
      +

      Ukranian Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case ukrainian = "uk"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + vietnamese + +
      +
      +
      +
      +
      +
      +

      Vietnamese Language Localization

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case vietnamese = "vi"
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel.html new file mode 100644 index 00000000..ad08f39d --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel.html @@ -0,0 +1,241 @@ + + + + LookupModel Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    LookupModel

    +
    +
    +
    public struct LookupModel : Decodable
    + +
    +
    +

    Model representing a selection of results from the iTunes Lookup API.

    + +
    +
    +
    +
      +
    • +
      + + + + CodingKeys + +
      +
      +
      +
      +
      +
      +

      Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum CodingKeys : String, CodingKey
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + results + +
      +
      +
      +
      +
      +
      +

      The array of results objects from the iTunes Lookup API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let results: [Results]
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + Results + +
      +
      +
      +
      +
      +
      +

      The Results object from the the iTunes Lookup API.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public struct Results : Decodable
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/CodingKeys.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/CodingKeys.html new file mode 100644 index 00000000..8bae8fe4 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/CodingKeys.html @@ -0,0 +1,185 @@ + + + + CodingKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CodingKeys

    +
    +
    +
    private enum CodingKeys : String, CodingKey
    + +
    +
    +

    Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

    + +
    +
    +
    +
      +
    • +
      + + + + results + +
      +
      +
      +
      +
      +
      +

      The results JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case results
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results.html new file mode 100644 index 00000000..6158798d --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results.html @@ -0,0 +1,321 @@ + + + + Results Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Results

    +
    +
    +
    public struct Results : Decodable
    + +
    +
    +

    The Results object from the the iTunes Lookup API.

    + +
    +
    +
    +
      +
    • +
      + + + + CodingKeys + +
      +
      +
      +
      +
      +
      +

      Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private enum CodingKeys : String, CodingKey
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + appID + +
      +
      +
      +
      +
      +
      +

      The app’s App ID.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let appID: Int
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The release date for the latest verison of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let currentVersionReleaseDate: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minimumOSVersion + +
      +
      +
      +
      +
      +
      +

      The minimum verison of iOS that the current verison of the app requires.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let minimumOSVersion: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + releaseNotes + +
      +
      +
      +
      +
      +
      +

      The releases notes from the latest version of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let releaseNotes: String?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version + +
      +
      +
      +
      +
      +
      +

      The latest version of the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public let version: String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results/CodingKeys.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results/CodingKeys.html new file mode 100644 index 00000000..0560df9b --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/LookupModel/Results/CodingKeys.html @@ -0,0 +1,293 @@ + + + + CodingKeys Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    CodingKeys

    +
    +
    +
    private enum CodingKeys : String, CodingKey
    + +
    +
    +

    Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

    + +
    +
    +
    +
      +
    • +
      + + + + appID + +
      +
      +
      +
      +
      +
      +

      The appID JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case appID = "trackId"
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The current version release date JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case currentVersionReleaseDate
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minimumOSVersion + +
      +
      +
      +
      +
      +
      +

      The minimum device iOS version compatibility JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minimumOSVersion = "minimumOsVersion"
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + releaseNotes + +
      +
      +
      +
      +
      +
      +

      The release notes JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case releaseNotes
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + version + +
      +
      +
      +
      +
      +
      +

      The current App Store version JSON key.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case version
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/PresentationManager.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/PresentationManager.html new file mode 100644 index 00000000..36ed26af --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/PresentationManager.html @@ -0,0 +1,838 @@ + + + + PresentationManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    PresentationManager

    +
    +
    +
    public struct PresentationManager
    + +
    +
    +

    PresentationManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + CompletionHandler + +
      +
      +
      +
      +
      +
      +

      Return results or errors obtained from performing a version check with Siren.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      typealias CompletionHandler = (AlertAction) -> Void
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localization + +
      +
      +
      +
      +
      +
      +

      The localization data structure that will be used to construct localized strings for the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let localization: Localization
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + tintColor + +
      +
      +
      +
      +
      +
      +

      The tint color of the UIAlertController buttons.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let tintColor: UIColor?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertMessage + +
      +
      +
      +
      +
      +
      +

      The descriptive update message of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertMessage: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertTitle + +
      +
      +
      +
      +
      +
      +

      The main message of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + nextTimeButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Next time button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let nextTimeButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skipButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Skip this version button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let skipButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateButtonTitle + +
      +
      +
      +
      +
      +
      +

      The Update button text of the UIAlertController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let updateButtonTitle: String
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + alertController + +
      +
      +
      +
      +
      +
      +

      The instance of the UIAlertController used to present the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var alertController: UIAlertController?
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updaterWindow + +
      +
      +
      +
      +
      +
      +

      The UIWindow instance that presents the SirenViewController.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private var updaterWindow: UIWindow { get }
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      PresentationManager‘s public initializer.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(alertTintColor tintColor: UIColor? = nil,
      +            appName: String? = nil,
      +            alertTitle: String  = AlertConstants.alertTitle,
      +            alertMessage: String  = AlertConstants.alertMessage,
      +            updateButtonTitle: String  = AlertConstants.updateButtonTitle,
      +            nextTimeButtonTitle: String  = AlertConstants.nextTimeButtonTitle,
      +            skipButtonTitle: String  = AlertConstants.skipButtonTitle,
      +            forceLanguageLocalization forceLanguage: Localization.Language? = nil)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + tintColor + + +
      +

      The alert’s tintColor. Settings this to nil defaults to the system default color.

      +
      +
      + + appName + + +
      +

      The name of the app (overrides the default/bundled name).

      +
      +
      + + alertTitle + + +
      +

      The title field of the UIAlertController.

      +
      +
      + + alertMessage + + +
      +

      The message field of the UIAlertController.

      +
      +
      + + nextTimeButtonTitle + + +
      +

      The title field of the Next Time Button UIAlertAction.

      +
      +
      + + skipButtonTitle + + +
      +

      The title field of the Skip Button UIAlertAction.

      +
      +
      + + updateButtonTitle + + +
      +

      The title field of the Update Button UIAlertAction.

      +
      +
      + + forceLanguage + + +
      +

      The language the alert to which the alert should be set. If nil, it falls back to the device’s preferred locale.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default PresentationManager.

      + +

      By default:

      + +
        +
      • There is no tint color (defaults to Apple’s system blue color.)
      • +
      • The name of the app is equal to the name that appears in Info.plist.
      • +
      • The strings are all set to that of the user’s device localization (if supported) or it falls back to English.
      • +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: PresentationManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
      +
      +
      +
      +

      Constructs the localized update alert UIAlertController object.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      mutating func presentAlert(withRules rules: Rules,
      +                           forCurrentAppStoreVersion currentAppStoreVersion: String,
      +                           completion handler: CompletionHandler?)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that are used to define the type of alert that should be presented.

      +
      +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + handler + + +
      +

      The completion handler that returns the an AlertAction depending on the type of action the end-user took.

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Update option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func updateAlertAction(completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler that returns the .update option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Update alert action.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Next time option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func nextTimeAlertAction(completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + handler + + +
      +

      The completion handler that returns the .nextTime option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Next time alert action.

      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      The UIAlertAction that is executed when the Skip this version option is selected.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      private func skipAlertAction(forCurrentAppStoreVersion currentAppStoreVersion: String, completion handler: CompletionHandler?) -> UIAlertAction
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + currentAppStoreVersion + + +
      +

      The current version of the app in the App Store.

      +
      +
      + + handler + + +
      +

      The completion handler that returns the .skip option.

      +
      +
      +
      +
      +

      Return Value

      +

      The Skip this version alert action.

      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Results.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Results.html new file mode 100644 index 00000000..b2deed5f --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Results.html @@ -0,0 +1,267 @@ + + + + Results Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Results

    +
    +
    +
    public struct Results
    + +
    +
    +

    The relevant metadata returned from Siren upon completing a successful version check.

    + +
    +
    +
    +
      +
    • +
      + + + + alertAction + +
      +
      +
      +
      +
      +
      +

      The UIAlertAction the user chose upon being presented with the update alert. +Defaults to unknown until an alert is actually presented.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var alertAction: AlertAction
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + localization + +
      +
      +
      +
      +
      +
      +

      The Siren-supported locale that was used for the string in the update alert.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var localization: Localization
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + lookupModel + +
      +
      +
      +
      +
      +
      +

      The Swift-mapped API model, if a successful version check was performed.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var lookupModel: LookupModel
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + updateType + +
      +
      +
      +
      +
      +
      +

      The type of update that was returned for the API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public var updateType: RulesManager.UpdateType
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules.html new file mode 100644 index 00000000..8d6d2ae2 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules.html @@ -0,0 +1,472 @@ + + + + Rules Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Rules

    +
    +
    +
    public struct Rules
    + +
    +
    +

    Alert Presentation Rules for Siren.

    + +
    +
    +
    +
      +
    • +
      + + + + alertType + +
      +
      +
      +
      +
      +
      +

      The type of alert that should be presented.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let alertType: AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + frequency + +
      +
      +
      +
      +
      +
      +

      The frequency in which a the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let frequency: UpdatePromptFrequency
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializes the alert presentation rules.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(promptFrequency frequency: UpdatePromptFrequency,
      +            forAlertType alertType: AlertType)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + frequency + + +
      +

      How often a user should be prompted to update the app once a new version is available in the App Store.

      +
      +
      + + alertType + + +
      +

      The type of alert that should be presented.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + annoying + +
      +
      +
      +
      +
      +
      +

      Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var annoying: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + critical + +
      +
      +
      +
      +
      +
      +

      Performs a version check immediately and forces the user to update the app.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var critical: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      Performs a version check once a day, but allows the user to skip updating the app until +the next time the app becomes active or skipping the update all together until another version is released.

      + +

      This is the default setting.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var `default`: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + persistent + +
      +
      +
      +
      +
      +
      +

      Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var persistent: Rules { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + relaxed + +
      +
      +
      +
      +
      +
      +

      Performs a version check weekly, but allows the user to skip updating the app until +the next time the app becomes active or skipping the update all together until another version is released.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static var relaxed: Rules { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + AlertType + +
      +
      +
      +
      +
      +
      +

      Determines the type of alert to present after a successful version check has been performed.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum AlertType
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + UpdatePromptFrequency + +
      +
      +
      +
      +
      +
      +

      Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdatePromptFrequency : UInt
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/AlertType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/AlertType.html new file mode 100644 index 00000000..a339ed4b --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/AlertType.html @@ -0,0 +1,267 @@ + + + + AlertType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    AlertType

    +
    +
    +
    public enum AlertType
    + +
    +
    +

    Determines the type of alert to present after a successful version check has been performed.

    + +
    +
    +
    +
      +
    • +
      + + + + force + +
      +
      +
      +
      +
      +
      +

      Forces the user to update your app (1 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case force
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + option + +
      +
      +
      +
      +
      +
      +

      Presents the user with option to update app now or at next launch (2 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case option
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + skip + +
      +
      +
      +
      +
      +
      +

      Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case skip
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + none + +
      +
      +
      +
      +
      +
      +

      Doesn’t present the alert. +Use this option if you would like to present a custom alert to the end-user.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case none
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePrompFrequency.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePrompFrequency.html new file mode 100644 index 00000000..85e98ed6 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePrompFrequency.html @@ -0,0 +1,237 @@ + + + + UpdatePrompFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (66% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdatePrompFrequency

    +
    +
    +
    public enum UpdatePrompFrequency : UInt
    + +
    +
    +

    Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePromptFrequency.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePromptFrequency.html new file mode 100644 index 00000000..d04dfa75 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/Rules/UpdatePromptFrequency.html @@ -0,0 +1,240 @@ + + + + UpdatePromptFrequency Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdatePromptFrequency

    +
    +
    +
    public enum UpdatePromptFrequency : UInt
    + +
    +
    +

    Determines the frequency in which the user is prompted to update the app +once a new version is available in the App Store and if they have not updated yet.

    + +
    +
    +
    +
      +
    • +
      + + + + immediately + +
      +
      +
      +
      +
      +
      +

      Version check performed every time the app is launched.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case immediately = 0
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + daily + +
      +
      +
      +
      +
      +
      +

      Version check performed once a day.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case daily = 1
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + weekly + +
      +
      +
      +
      +
      +
      +

      Version check performed once a week.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case weekly = 7
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager.html new file mode 100644 index 00000000..b9b2be68 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager.html @@ -0,0 +1,570 @@ + + + + RulesManager Structure Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    RulesManager

    +
    +
    +
    public struct RulesManager
    + +
    +
    +

    RulesManager for Siren

    + +
    +
    +
    +
      +
    • +
      + + + + releasedForDays + +
      +
      +
      +
      +
      +
      +

      The alert will only show up if the current version has already been released for X days.

      + +

      This value defaults to 1 day (in RulesManager‘s initializer) to avoid an issue where +Apple updates the JSON faster than the app binary propogates to the App Store.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      let releasedForDays: Int
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + majorUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a major version update (A.b.c.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var majorUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minorUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a minor version update (a.B.c.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var minorUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patchUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a patch version update (a.b.C.d).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var patchUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revisionUpdateRules + +
      +
      +
      +
      +
      +
      +

      The Rules that should be used when the App Store version of the app signifies that it is a revision version update (a.b.c.D).

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      var revisionUpdateRules: Rules
      + +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializer that sets update-specific Rules for all updates (e.g., major, minor, patch, revision). +This means that each of the four update types can have their own specific update rules.

      + +

      By default, the releasedForDays parameter delays the update alert from being presented for 1 day +to avoid an issue where the iTunes Lookup API response is updated faster than the time it takes for the binary +to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the 1 day delay.

      +
      +

      Warning

      +

      Setting releasedForDays to 0 days causes the alert to appear right away, even if the binary isn’t available. +If this value is set to 0 days, and an AlertType of type .force is set, it will cause your app to infinitely send the +end-user to the App Store to download a version that’s not there and lock them out of your application until the binary is +is available to be downloaded.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(majorUpdateRules: Rules = .default,
      +            minorUpdateRules: Rules = .default,
      +            patchUpdateRules: Rules = .default,
      +            revisionUpdateRules: Rules = .default,
      +            showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that should be set for all version updates.

      +
      +
      + + releasedForDays + + +
      +

      The amount of time (in days) that the app should delay before presenting the user

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Initializer that sets the same update Rules for all types of updates (e.g., major, minor, patch, revision). +This means that all four update types will use the same presentation rules.

      + +

      By default, the releasedForDays parameter delays the update alert from being presented for 1 day +to avoid an issue where the iTunes Lookup API response is updated faster than the time it takes for the binary +to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the 1 day delay.

      +
      +

      Warning

      +

      Setting releasedForDays to 0 days causes the alert to appear right away, even if the binary isn’t available. +If this value is set to 0 days, and an AlertType of type .force is set, it will cause your app to infinitely send the +end-user to the App Store to download a version that’s not there and lock them out of your application until the binary is +is available to be downloaded.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public init(globalRules rules: Rules = .default,
      +            showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + rules + + +
      +

      The rules that should be set for all version updates.

      +
      +
      + + releasedForDays + + +
      +

      The amount of time (in days) that the app should delay before presenting the user

      +
      +
      +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Returns the appropriate update rules based on the type of version that is returned from the API.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func loadRulesForUpdateType(_ type: UpdateType) -> Rules
      + +
      +
      +
      +

      Parameters

      + + + + + + + +
      + + type + + +
      +

      The type of app update.

      +
      +
      +
      +
      +

      Return Value

      +

      The appropriate rule based on the type of app update that is returned by the API.

      +
      +
      +
      +
    • +
    • +
      + + + + default + +
      +
      +
      +
      +
      +
      +

      The default RulesManager.

      + +

      By default, the Rules.default rule is used for all update typs.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public static let `default`: RulesManager
      + +
      +
      +
      +
      +
    • +
    +
    +
    + +
      +
    • +
      + + + + UpdateType + +
      +
      +
      +
      +
      +
      +

      Informs Siren of the type of update that is available so that +the appropriate ruleset is used to present the update alert.

      + +
        +
      • major: Major release available: A.b.c.d
      • +
      • minor: Minor release available: a.B.c.d
      • +
      • patch: Patch release available: a.b.C.d
      • +
      • revision: Revision release available: a.b.c.D
      • +
      • unknown: No information available about the update.
      • +
      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public enum UpdateType : String
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager/UpdateType.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager/UpdateType.html new file mode 100644 index 00000000..c061dcb7 --- /dev/null +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/RulesManager/UpdateType.html @@ -0,0 +1,302 @@ + + + + UpdateType Enumeration Reference + + + + + + + + + + +
    +
    +

    Siren Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    UpdateType

    +
    +
    +
    public enum UpdateType : String
    + +
    +
    +

    Informs Siren of the type of update that is available so that +the appropriate ruleset is used to present the update alert.

    + +
      +
    • major: Major release available: A.b.c.d
    • +
    • minor: Minor release available: a.B.c.d
    • +
    • patch: Patch release available: a.b.C.d
    • +
    • revision: Revision release available: a.b.c.D
    • +
    • unknown: No information available about the update.
    • +
    + +
    +
    +
    +
      +
    • +
      + + + + major + +
      +
      +
      +
      +
      +
      +

      Major release available: A.b.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case major
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + minor + +
      +
      +
      +
      +
      +
      +

      Minor release available: a.B.c.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case minor
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + patch + +
      +
      +
      +
      +
      +
      +

      Patch release available: a.b.C.d

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case patch
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + revision + +
      +
      +
      +
      +
      +
      +

      Revision release available: a.b.c.D

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case revision
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + unknown + +
      +
      +
      +
      +
      +
      +

      No information available about the update.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      case unknown
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging.html index 8afae6bf..912a86f1 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging.html @@ -139,9 +139,9 @@

    Declaration

  • @@ -239,7 +239,7 @@

    Parameters

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging/Constants.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging/Constants.html index 9aa14fd1..a0c6d8aa 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging/Constants.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenAlertMessaging/Constants.html @@ -241,7 +241,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError.html index 22344b0a..72b4ead7 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError.html @@ -147,7 +147,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError/Known.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError/Known.html index b318c9d3..89f03cbc 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError/Known.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenError/Known.html @@ -117,9 +117,9 @@

    Known

  • @@ -144,9 +144,9 @@

    Declaration

  • @@ -171,9 +171,9 @@

    Declaration

  • @@ -198,9 +198,9 @@

    Declaration

  • @@ -225,9 +225,9 @@

    Declaration

  • @@ -252,9 +252,9 @@

    Declaration

  • @@ -279,9 +279,9 @@

    Declaration

  • @@ -306,9 +306,9 @@

    Declaration

  • @@ -333,9 +333,9 @@

    Declaration

  • @@ -360,9 +360,9 @@

    Declaration

  • @@ -389,7 +389,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel.html index 16e627fd..4be7a899 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel.html @@ -161,7 +161,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel/Results.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel/Results.html index fb1d7aa5..245d7b7a 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel/Results.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/Structs/SirenLookupModel/Results.html @@ -241,7 +241,7 @@

    Declaration

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/index.html b/docs/docsets/Siren.docset/Contents/Resources/Documents/index.html index 86a7956d..8a84d714 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/index.html @@ -33,13 +33,7 @@ Siren
  • - - @@ -47,15 +41,33 @@ Enumerations @@ -63,22 +75,52 @@ Structures @@ -101,16 +143,15 @@

    Table of Contents

  • Features
  • Screenshots
  • Installation Instructions
  • -
  • Example Code
  • -
  • Granular/Differentiated Version Management
  • -
  • Delegates (Optional)
  • +
  • Implementation Examples
  • Localization
  • Device Compatibility
  • Testing Siren
  • App Store Review & Submissions
  • -
  • Phrased Releases
  • +
  • Phased Releases
  • Words of Caution
  • Ports
  • +
  • Shout-Out and Gratitude
  • Attribution
  • @@ -125,28 +166,27 @@

    About

  • Siren is built to work with the Semantic Versioning system.
      -
    • Semantic Versioning is a three number versioning system (e.g., 1.0.0)
    • +
    • Canonical Semantic Versioning uses a three number versioning system (e.g., 1.0.0)
    • Siren also supports two-number versioning (e.g., 1.0) and four-number versioning (e.g., 1.0.0.0)
  • -
  • Siren is actively maintained by Arthur Sabintsev and Aaron Brager
  • -

    README Translations

    +

    Features

    +

    Current Features

    -

    Features

    +

    Future Features

      -
    • [x] CocoaPods Support
    • -
    • [x] Carthage Support
    • -
    • [x] Swift Package Manager Support
    • -
    • [x] Localized for 30+ languages (see Localization)
    • -
    • [x] Pre-Update Device Compatibility Check (see Device Compatibility)
    • -
    • [x] Three types of alerts (see Screenshots)
    • -
    • [x] Optional delegate methods (see Delegates (Optional))
    • -
    • [x] Unit Tests
    • -
    • [x] Documentation can be found at http://sabintsev.com/Siren.
    • +
    • [ ] Present prompt only on WiFi if app is over the OTA limit.
    • +
    • [ ] Support for Third-/Homegrown Update Servers (not including TestFlight).
    • +
    • [ ] Increase code coverage with more unit tests and UI tests.

    Screenshots

    @@ -154,7 +194,7 @@

    Screenshots

  • The left picture forces the user to update the app.
  • The center picture gives the user the option to update the app.
  • The right picture gives the user the option to skip the current update.
  • -
  • These options are controlled by the Siren.AlertType enum.
  • +
  • These options are controlled by the Rules.AlertType enum.
  • @@ -202,196 +242,56 @@

    CocoaPods

    Carthage

    github "ArtSabintsev/Siren" // Swift 4.2
    -github "ArtSabintsev/Siren", "swift4.1" // Swift 4.1
    -github "ArtSabintsev/Siren", "swift3.2" // Swift 3.2
    -github "ArtSabintsev/Siren", "swift3.1" // Swift 3.1
    -github "ArtSabintsev/Siren", "swift2.3" // Swift 2.3
    +github "ArtSabintsev/Siren" "swift4.1" // Swift 4.1
    +github "ArtSabintsev/Siren" "swift3.2" // Swift 3.2
    +github "ArtSabintsev/Siren" "swift3.1" // Swift 3.1
    +github "ArtSabintsev/Siren" "swift2.3" // Swift 2.3
     

    Swift Package Manager

    -
    .Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 3)
    +
    .Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 4)
     
    -

    Example Code

    - -

    Below is some commented sample code. Adapt this to meet your app’s needs.

    - -

    For a full list of optional settings/preferences, please refer to https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift in the Sample Project.

    -
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    -    /* Siren code should go below window?.makeKeyAndVisible() */
    +

    Implementation Examples

    - // Siren is a singleton - let siren = Siren.shared +

    Implementing Siren is as easy as adding two line of code to your app.

    +
    import Siren // Line 1
    +import UIKit
     
    -    // Optional: Defaults to .option
    -    siren.alertType = <#Siren.AlertType_Enum_Value#>
    +@UIApplicationMain
    +final class AppDelegate: UIResponder, UIApplicationDelegate {
    +    var window: UIWindow?
     
    -    // Optional: Change the various UIAlertController and UIAlertAction messaging. One or more values can be changes. If only a subset of values are changed, the defaults with which Siren comes with will be used.
    -    siren.alertMessaging = SirenAlertMessaging(updateTitle: NSAttributedString(string: "New Fancy Title"),
    -                                                updateMessage: NSAttributedString(string: "New message goes here!"),
    -                                                updateButtonMessage: NSAttributedString(string: "Update Now, Plz!?"),
    -                                                nextTimeButtonMessage: NSAttributedString(string: "OK, next time it is!"),
    -                                                skipVersionButtonMessage: NSAttributedString(string: "Please don't push skip, please don't!"))
    +    func application(_ application: UIApplication,
    +                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    +        window?.makeKeyAndVisible()
     
    +        Siren.shared.wail() // Line 2
     
    -    // Optional: Set this variable if you would only like to show an alert if your app has been available on the store for a few days.
    -    // This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution
    -    // To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution.
    -    siren.showAlertAfterCurrentVersionHasBeenReleasedForDays = 3
    -
    -    // Replace .immediately with .daily or .weekly to specify a maximum daily or weekly frequency for version checks.
    -    // DO NOT CALL THIS METHOD IN didFinishLaunchingWithOptions IF YOU ALSO PLAN TO CALL IT IN applicationDidBecomeActive.
    -    siren.checkVersion(checkType: .immediately)
    -
    -    return true
    -}
    -
    -func applicationDidBecomeActive(application: UIApplication) {
    -    /*
    -        Perform daily (.daily) or weekly (.weekly) checks for new version of your app.
    -        Useful if user returns to your app from the background after extended period of time.
    -            Place in applicationDidBecomeActive(_:).
    -     */
    -
    -    Siren.shared.checkVersion(checkType: .daily)
    -}
    -
    -func applicationWillEnterForeground(application: UIApplication) {
    -   /*
    -      Useful if user returns to your app from the background after being sent to the
    -      App Store, but doesn't update their app before coming back to your app.
    -
    -      ONLY USE WITH Siren.AlertType.immediately
    -   */
    -
    -    Siren.shared.checkVersion(checkType: .immediately)
    -}
    -
    - -

    And you’re all set!

    -

    Prompting for Updates without Alerts

    - -

    Some developers may want to display a less obtrusive custom interface, like a banner or small icon. To accomplish this, you can disable alert presentation by doing the following:

    -
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    -    ...
    -    siren.delegate = self
    -    siren.alertType = .none
    -    ...
    -}
    -
    -extension AppDelegate: SirenDelegate {
    -    // Returns a localized message to this delegate method upon performing a successful version check
    -    func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType) {
    -        print("\(message)")
    +        return true
         }
     }
     
    -

    Siren will call the sirenDidDetectNewVersionWithoutAlert(message: String) delegate method, passing a localized, suggested update string suitable for display. Implement this method to display your own messaging, optionally using message.

    -

    Granular Version Update Management

    +

    Siren also has plenty of customization options. All examples can be found in the Example Project’s AppDelegate file. Uncomment the example you’d like to test.

    -

    If you would like to set a different type of alert for revision, patch, minor, and/or major updates, simply add one or all of the following optional lines to your setup before calling the checkVersion() method:

    -
        /* Siren defaults to Siren.AlertType.option for all updates */
    -    siren.shared.revisionUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.patchUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.minorUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.majorUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -
    -

    Optional Delegate and Delegate Methods

    - -

    Six delegate methods allow you to handle or track the user’s behavior. Each method has a default, empty implementation, effectively making each of these methods optional.

    -
    public protocol SirenDelegate: NSObjectProtocol {
    -    /// Siren performed version check and did not display alert.
    -    func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType)
    -
    -    /// Siren failed to perform version check.
    -    ///
    -    /// - Note:
    -    ///     Depending on the reason for failure,
    -    ///     a system-level error may be returned.
    -    func sirenDidFailVersionCheck(error: Error)
    -
    -    /// User presented with update dialog.
    -    func sirenDidShowUpdateDialog(alertType: Siren.AlertType)
    -
    -    /// Siren performed a version check and latest version is installed.
    -    func sirenLatestVersionInstalled()
    -
    -    /// Provides the decoded JSON information from a successful version check call.
    -    ///
    -    /// - SeeAlso:
    -    ///     SirenLookupModel.swift
    -    ///
    -    /// - Parameter lookupModel: The `Decodable` model representing the JSON results from the iTunes Lookup API.
    -    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel)
    -
    -    /// User did click on button that cancels update dialog.
    -    func sirenUserDidCancel()
    -
    -    /// User did click on button that launched "App Store.app".
    -    func sirenUserDidLaunchAppStore()
    -
    -    /// User did click on button that skips version update.
    -    func sirenUserDidSkipVersion()
    -}
    -
    +

    WARNING: Siren should ONLY be placed in UIApplication.didFinishLaunchingWithOptions and only after the window?.makeKeyAndVisible() call. Siren initializes a listener on didBecomeActiveNotification to perform version checks.

    Localization

    -

    Siren is localized for

    +

    Siren is localized for the following languages:

    -
      -
    • Arabic
    • -
    • Armenian
    • -
    • Basque
    • -
    • Chinese (Simplified and Traditional)
    • -
    • Croatian
    • -
    • Czech
    • -
    • Danish
    • -
    • Dutch
    • -
    • English
    • -
    • Estonian
    • -
    • Finnish
    • -
    • French
    • -
    • German
    • -
    • Greek
    • -
    • Hebrew
    • -
    • Hungarian
    • -
    • Indonesian
    • -
    • Italian
    • -
    • Japanese
    • -
    • Korean
    • -
    • Latvian
    • -
    • Lithuanian
    • -
    • Malay
    • -
    • Norwegian (Bokmål)
    • -
    • Persian (Afghanistan, Iran, Persian)
    • -
    • Polish
    • -
    • Portuguese (Brazil and Portugal)
    • -
    • Russian
    • -
    • Serbian (Cyrillic and Latin)
    • -
    • Slovenian
    • -
    • Spanish
    • -
    • Swedish
    • -
    • Thai
    • -
    • Turkish
    • -
    • Ukrainian
    • -
    • Urdu
    • -
    • Vietnamese
    • -
    - -

    You may want the update dialog to always appear in a certain language, ignoring iOS’s language setting (e.g. apps released in a specific country).

    +

    Arabic, Armenian, Basque, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian (Bokmål), Persian (Afghanistan, Iran, Persian), Polish, Portuguese (Brazil and Portugal), Russian, Serbian (Cyrillic and Latin), Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Urdu, Vietnamese

    -

    You can enable it like so:

    -
    Siren.shared.forceLanguageLocalization = Siren.LanguageType.<#Siren.LanguageType_Enum_Value#>
    +

    You may want the update dialog to always appear in a certain language, ignoring the user’s device-specific setting. You can enable it like so:

    +
    // In this example, we force the `russian` language.
    +Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian)
     

    Device Compatibility

    -

    If an app update is available, Siren checks to make sure that the version of iOS on the user’s device is compatible with the one that is required by the app update. For example, if a user has iOS 10 installed on their device, but the app update requires iOS 11, an alert will not be shown. This takes care of the false positive case regarding app updating.

    +

    If an app update is available, Siren checks to make sure that the version of iOS on the user’s device is compatible with the one that is required by the app update. For example, if a user has iOS 11 installed on their device, but the app update requires iOS 12, an alert will not be shown. This takes care of the false positive case regarding app updating.

    Testing Siren

    -

    Temporarily change the version string in Xcode (within the .xcodeproj) to an older version than the one that’s currently available in the App Store. Afterwards, build and run your app, and you should see the alert.

    +

    Temporarily change the version string in Xcode (within the .xcodeproj file) to an older version than the one that’s currently available in the App Store. Afterwards, build and run your app, and you should see the alert.

    If you currently don’t have an app in the store, change your bundleID to one that is already in the store. In the sample app packaged with this library, we use the App Store Connect app’s bundleID: com.apple.AppStoreConnect.

    - -

    For your convenience, you may turn on debugging statements by setting self.debugEnabled = true before calling the checkVersion() method.

    App Store Submissions

    The App Store reviewer will not see the alert. The version in the App Store will always be older than the version being reviewed.

    @@ -401,7 +301,7 @@

    Phased Releases

    • You can leave Siren configured as normal. Phased rollout will continue to auto-update apps. Since all users can still manually update your app directly from the App Store, Siren will ignore the phased rollout and will prompt users to update.
    • -
    • You can set showAlertAfterCurrentVersionHasBeenReleasedForDays to 7, and Siren will not prompt any users until the latest version is 7 days old, after phased rollout is complete.
    • +
    • You can set showAlertAfterCurrentVersionHasBeenReleasedForDays to 7, and Siren will not prompt any users until the latest version is 7 days old, after the phased rollout is complete.
    • You can remotely disable Siren until the rollout is done using your own API / backend logic.

    Words of Caution

    @@ -415,6 +315,7 @@

    Ports

    • Harpy
    • Siren was ported from Harpy, as Siren and Harpy are maintained by the same developer.
    • +
    • As of December 2018, Harpy has been deprecated in favor of Siren.
  • Java (Android) @@ -429,14 +330,23 @@

    Ports

  • The Siren Swift library inspired the React Native library.
  • +

    Shout-Out and Gratitude

    + +

    A massive shout-out and thank you goes to the following folks:

    + +
      +
    • Aaron Brager for motivating me and assisting me in building the initial proof-of-concept of Siren (based on Harpy) back in 2015. Without him, Siren may never have been built.
    • +
    • All of Harpy’s Consitrbutors for helping building the feature set from 2012-2015 that was used as the basis for the first version of Siren.
    • +
    • All of Siren’s Contributors for helping make Siren as powerful and bug-free as it currently is today.
    • +

    Created and maintained by

    -

    Arthur Ariel Sabintsev & Aaron Brager

    +

    Arthur Ariel Sabintsev

    diff --git a/docs/docsets/Siren.docset/Contents/Resources/Documents/search.json b/docs/docsets/Siren.docset/Contents/Resources/Documents/search.json index 53596f3b..140126da 100644 --- a/docs/docsets/Siren.docset/Contents/Resources/Documents/search.json +++ b/docs/docsets/Siren.docset/Contents/Resources/Documents/search.json @@ -1 +1 @@ -{"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO20appStoreAppIDFailureyA2EmF":{"name":"appStoreAppIDFailure","abstract":"

    Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO28appStoreDataRetrievalFailureyAEs0B0_pSg_tcAEmF":{"name":"appStoreDataRetrievalFailure(underlyingError:)","abstract":"

    Error retrieving App Store data as an error was returned.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO26appStoreJSONParsingFailureyAEs0B0_p_tcAEmF":{"name":"appStoreJSONParsingFailure(underlyingError:)","abstract":"

    Error parsing App Store JSON data.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO33appStoreDataRetrievalEmptyResultsyA2EmF":{"name":"appStoreDataRetrievalEmptyResults","abstract":"

    Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO30appStoreOSVersionNumberFailureyA2EmF":{"name":"appStoreOSVersionNumberFailure","abstract":"

    Error retrieving iOS version number as there was no data returned.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO28appStoreOSVersionUnsupportedyA2EmF":{"name":"appStoreOSVersionUnsupported","abstract":"

    The version of iOS on the device is lower than that of the one required by the app verison update.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO27appStoreVersionArrayFailureyA2EmF":{"name":"appStoreVersionArrayFailure","abstract":"

    Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO12malformedURLyA2EmF":{"name":"malformedURL","abstract":"

    The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO17noUpdateAvailableyA2EmF":{"name":"noUpdateAvailable","abstract":"

    No new update available.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO22recentlyCheckedAlreadyyA2EmF":{"name":"recentlyCheckedAlready","abstract":"

    Not checking the version, because it was already checked recently.

    ","parent_name":"Known"},"Structs/SirenError/Known.html":{"name":"Known","abstract":"

    Enumerates all potentials errors that Siren can handle.

    ","parent_name":"SirenError"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV5appIDSivp":{"name":"appID","abstract":"

    The app’s App ID.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV25currentVersionReleaseDateSSvp":{"name":"currentVersionReleaseDate","abstract":"

    The release date for the latest verison of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV16minimumOSVersionSSvp":{"name":"minimumOSVersion","abstract":"

    The minimum verison of iOS that the current verison of the app requires.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV12releaseNotesSSSgvp":{"name":"releaseNotes","abstract":"

    The releases notes from the latest version of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV7versionSSvp":{"name":"version","abstract":"

    The latest version of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel.html#/s:5Siren0A11LookupModelV7resultsSayAC7ResultsVGvp":{"name":"results","abstract":"

    The array of results objects from the iTunes Lookup API.

    ","parent_name":"SirenLookupModel"},"Structs/SirenLookupModel/Results.html":{"name":"Results","abstract":"

    The Results object from the the iTunes Lookup API.

    ","parent_name":"SirenLookupModel"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV8nextTimeSo18NSAttributedStringCvpZ":{"name":"nextTime","abstract":"

    The button text that conveys the message that the user should be prompted to update next time the app launches.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV11skipVersionSo18NSAttributedStringCvpZ":{"name":"skipVersion","abstract":"

    The text that conveys the message that the the user wants to skip this verison update.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV13updateMessageSo18NSAttributedStringCvpZ":{"name":"updateMessage","abstract":"

    The text that conveys the message that there is an app update available

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV11updateTitleSo18NSAttributedStringCvpZ":{"name":"updateTitle","abstract":"

    The alert title which defaults to Update Available.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV9updateNowSo18NSAttributedStringCvpZ":{"name":"updateNow","abstract":"

    The button text that conveys the message that the user would like to update the app right away.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html":{"name":"Constants","abstract":"

    The default constants used for the alert messaging.

    ","parent_name":"SirenAlertMessaging"},"Structs/SirenAlertMessaging.html#/s:5Siren0A14AlertMessagingV11updateTitle0D7Message0d6ButtonF008nextTimegF0011skipVersiongF0ACSo18NSAttributedStringC_A4Jtcfc":{"name":"init(updateTitle:updateMessage:updateButtonMessage:nextTimeButtonMessage:skipVersionButtonMessage:)","abstract":"

    The public initializer

    ","parent_name":"SirenAlertMessaging"},"Structs/SirenAlertMessaging.html":{"name":"SirenAlertMessaging","abstract":"

    Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

    "},"Structs/SirenLookupModel.html":{"name":"SirenLookupModel","abstract":"

    MARK: Siren extension used to parse and map the iTunes JSON results into a model represented in Swift.

    "},"Structs/SirenError.html":{"name":"SirenError","abstract":"

    Data structure used to build Siren specific Errors.

    "},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP36sirenDidDetectNewVersionWithoutAlert5title7message10updateTypeySS_SSAA06UpdateM0OtF":{"name":"sirenDidDetectNewVersionWithoutAlert(title:message:updateType:)","abstract":"

    Siren performed a version check and did not display an alert.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP24sirenDidFailVersionCheck5errorys5Error_p_tF":{"name":"sirenDidFailVersionCheck(error:)","abstract":"

    Siren failed to perform version check.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP24sirenDidShowUpdateDialog9alertTypeyA2AC05AlertI0O_tF":{"name":"sirenDidShowUpdateDialog(alertType:)","abstract":"

    User presented with an update dialog.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP27sirenLatestVersionInstalledyyF":{"name":"sirenLatestVersionInstalled()","abstract":"

    Siren performed a version check and the latest version was already installed.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP50sirenNetworkCallDidReturnWithNewVersionInformation11lookupModelyAA0a6LookupM0V_tF":{"name":"sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:)","abstract":"

    Provides the decoded JSON information from a successful version check call.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP18sirenUserDidCancelyyF":{"name":"sirenUserDidCancel()","abstract":"

    User did click on button that cancels update dialog.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP26sirenUserDidLaunchAppStoreyyF":{"name":"sirenUserDidLaunchAppStore()","abstract":"

    User did click on button that launched App Store.app.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP23sirenUserDidSkipVersionyyF":{"name":"sirenUserDidSkipVersion()","abstract":"

    User did click on button that skips version update.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html":{"name":"SirenDelegate","abstract":"

    Delegate that handles all codepaths for Siren upon version check completion.

    "},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5majoryA2CmF":{"name":"major","abstract":"

    Major release available: A.b.c.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5minoryA2CmF":{"name":"minor","abstract":"

    Minor release available: a.B.c.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5patchyA2CmF":{"name":"patch","abstract":"

    Patch release available: a.b.C.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO8revisionyA2CmF":{"name":"revision","abstract":"

    Revision release available: a.b.c.D

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO7unknownyA2CmF":{"name":"unknown","abstract":"

    No information available about the update.

    ","parent_name":"UpdateType"},"Enums/UpdateType.html":{"name":"UpdateType","abstract":"

    MARK - Siren UpdateType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6arabicyA2DmF":{"name":"arabic","abstract":"

    Arabic

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8armenianyA2DmF":{"name":"armenian","abstract":"

    Armenian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6basqueyA2DmF":{"name":"basque","abstract":"

    Basque

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO17chineseSimplifiedyA2DmF":{"name":"chineseSimplified","abstract":"

    Simplified Chinese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18chineseTraditionalyA2DmF":{"name":"chineseTraditional","abstract":"

    Traditional Chinese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8croatianyA2DmF":{"name":"croatian","abstract":"

    Croatian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5czechyA2DmF":{"name":"czech","abstract":"

    Czech

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6danishyA2DmF":{"name":"danish","abstract":"

    Danish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5dutchyA2DmF":{"name":"dutch","abstract":"

    Dutch

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7englishyA2DmF":{"name":"english","abstract":"

    English

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8estonianyA2DmF":{"name":"estonian","abstract":"

    Estonian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7finnishyA2DmF":{"name":"finnish","abstract":"

    Finnish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6frenchyA2DmF":{"name":"french","abstract":"

    French

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6germanyA2DmF":{"name":"german","abstract":"

    German

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5greekyA2DmF":{"name":"greek","abstract":"

    Greek

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6hebrewyA2DmF":{"name":"hebrew","abstract":"

    Hebrew

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9hungarianyA2DmF":{"name":"hungarian","abstract":"

    Hungarian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10indonesianyA2DmF":{"name":"indonesian","abstract":"

    Indonesian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7italianyA2DmF":{"name":"italian","abstract":"

    Italian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8japaneseyA2DmF":{"name":"japanese","abstract":"

    Japanese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6koreanyA2DmF":{"name":"korean","abstract":"

    Korean

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7latvianyA2DmF":{"name":"latvian","abstract":"

    Latvian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10lithuanianyA2DmF":{"name":"lithuanian","abstract":"

    Lithuanian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5malayyA2DmF":{"name":"malay","abstract":"

    Malaysian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9norwegianyA2DmF":{"name":"norwegian","abstract":"

    Norwegian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7persianyA2DmF":{"name":"persian","abstract":"

    Persian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18persianAfghanistanyA2DmF":{"name":"persianAfghanistan","abstract":"

    Persian (Afghanistan)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO11persianIranyA2DmF":{"name":"persianIran","abstract":"

    Persian (Iran)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6polishyA2DmF":{"name":"polish","abstract":"

    Polish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO16portugueseBrazilyA2DmF":{"name":"portugueseBrazil","abstract":"

    Portuguese (Brazil)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18portuguesePortugalyA2DmF":{"name":"portuguesePortugal","abstract":"

    Portuguese (Portugal)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7russianyA2DmF":{"name":"russian","abstract":"

    Russian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO15serbianCyrillicyA2DmF":{"name":"serbianCyrillic","abstract":"

    Serbian (Cyrillic)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO12serbianLatinyA2DmF":{"name":"serbianLatin","abstract":"

    Serbian (Latin)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9slovenianyA2DmF":{"name":"slovenian","abstract":"

    Slovenian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7spanishyA2DmF":{"name":"spanish","abstract":"

    Spanish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7swedishyA2DmF":{"name":"swedish","abstract":"

    Swedish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO4thaiyA2DmF":{"name":"thai","abstract":"

    Thai

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7turkishyA2DmF":{"name":"turkish","abstract":"

    Turkish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO4urduyA2DmF":{"name":"urdu","abstract":"

    Urdu

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9ukrainianyA2DmF":{"name":"ukrainian","abstract":"

    Ukranian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10vietnameseyA2DmF":{"name":"vietnamese","abstract":"

    Vietnamese

    ","parent_name":"LanguageType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO11immediatelyyA2DmF":{"name":"immediately","abstract":"

    Version check performed every time the app is launched.

    ","parent_name":"VersionCheckType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO5dailyyA2DmF":{"name":"daily","abstract":"

    Version check performed once a day.

    ","parent_name":"VersionCheckType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO6weeklyyA2DmF":{"name":"weekly","abstract":"

    Version check performed once a week.

    ","parent_name":"VersionCheckType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO5forceyA2DmF":{"name":"force","abstract":"

    Forces user to update your app (1 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO6optionyA2DmF":{"name":"option","abstract":"

    (DEFAULT) Presents user with option to update app now or at next launch (2 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO4skipyA2DmF":{"name":"skip","abstract":"

    Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO4noneyA2DmF":{"name":"none","abstract":"

    Doesn’t show the alert, but instead returns a localized message","parent_name":"AlertType"},"Classes/Siren.html#/s:5SirenAAC0A11ErrorDomainSSvp":{"name":"SirenErrorDomain","abstract":"

    The error domain for all errors created by Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC8delegateAA0A8Delegate_pSgXwvp":{"name":"delegate","abstract":"

    The SirenDelegate variable, which should be set if you’d like to be notified of any of specific user interactions or API success/failures.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12debugEnabledSbvp":{"name":"debugEnabled","abstract":"

    The debug flag, which is disabled by default.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC9alertTypeAB05AlertC0Ovp":{"name":"alertType","abstract":"

    Determines the type of alert that should be shown.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20majorUpdateAlertTypeAB0dE0Ovp":{"name":"majorUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for major version updates: A.b.c","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20minorUpdateAlertTypeAB0dE0Ovp":{"name":"minorUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for minor version updates: a.B.c","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20patchUpdateAlertTypeAB0dE0Ovp":{"name":"patchUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for minor patch updates: a.b.C","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23revisionUpdateAlertTypeAB0dE0Ovp":{"name":"revisionUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for revision updates: a.b.c.D","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC7appNameSSvp":{"name":"appName","abstract":"

    The name of your app.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14alertMessagingAA0a5AlertC0Vvp":{"name":"alertMessaging","abstract":"

    Overrides all the Strings to which Siren defaults.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC11countryCodeSSSgvp":{"name":"countryCode","abstract":"

    The region or country of an App Store in which your app is available.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC25forceLanguageLocalizationAB0C4TypeOSgvp":{"name":"forceLanguageLocalization","abstract":"

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC24alertControllerTintColorSo7UIColorCSgvp":{"name":"alertControllerTintColor","abstract":"

    Overrides the tint color for UIAlertController.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC50showAlertAfterCurrentVersionHasBeenReleasedForDaysSivp":{"name":"showAlertAfterCurrentVersionHasBeenReleasedForDays","abstract":"

    When this is set, the alert will only show up if the current version has already been released for X days.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC22currentAppStoreVersionSSSgvp":{"name":"currentAppStoreVersion","abstract":"

    The current version of your app that is available for download on the App Store

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC6sharedABvpZ":{"name":"shared","abstract":"

    The App’s Singleton

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12checkVersion0B4TypeyAB0c5CheckD0O_tF":{"name":"checkVersion(checkType:)","abstract":"

    Checks the currently installed version of your app against the App Store.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14launchAppStoreyyF":{"name":"launchAppStore()","abstract":"

    Launches the AppStore in two situations:

    ","parent_name":"Siren"},"Classes/Siren/AlertType.html":{"name":"AlertType","abstract":"

    Determines the type of alert to present after a successful version check has been performed.

    ","parent_name":"Siren"},"Classes/Siren/VersionCheckType.html":{"name":"VersionCheckType","abstract":"

    Determines the frequency in which the the version check is performed and the user is prompted to update the app.

    ","parent_name":"Siren"},"Classes/Siren/LanguageType.html":{"name":"LanguageType","abstract":"

    Determines the available languages in which the update message and alert button titles should appear.

    ","parent_name":"Siren"},"Classes/Siren.html":{"name":"Siren","abstract":"

    The Siren Class. A singleton that is initialized using the shared constant.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "}} \ No newline at end of file +{"Structs/DataParser.html#/s:5Siren10DataParserV22isAppStoreVersionNewer09installedG003appfG0SbSSSg_AGtFZ":{"name":"isAppStoreVersionNewer(installedVersion:appStoreVersion:)","abstract":"

    Checks to see if the App Store version of the app is newer than the installed version.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV30isUpdateCompatibleWithDeviceOS3forSbAA11LookupModelV_tFZ":{"name":"isUpdateCompatibleWithDeviceOS(for:)","abstract":"

    Validates that the latest version in the App Store is compatible with the device’s current version of iOS.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV14parseForUpdate19forInstalledVersion011andAppStoreI0AA12RulesManagerV0F4TypeOSSSg_AKtFZ":{"name":"parseForUpdate(forInstalledVersion:andAppStoreVersion:)","abstract":"

    The type of update that is returned from the API in relation to the verison of the app that is installed.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV5split33_35354280B893AD05C0C27D0AD925B30FLL7versionSaySiGSS_tFZ":{"name":"split(version:)","abstract":"

    Splits a version-formatted String into an[Int]`.

    ","parent_name":"DataParser"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO11immediatelyyA2EmF":{"name":"immediately","abstract":"

    Version check performed every time the app is launched.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO5dailyyA2EmF":{"name":"daily","abstract":"

    Version check performed once a day.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO6weeklyyA2EmF":{"name":"weekly","abstract":"

    Version check performed once a week.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO5forceyA2EmF":{"name":"force","abstract":"

    Forces the user to update your app (1 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO6optionyA2EmF":{"name":"option","abstract":"

    Presents the user with option to update app now or at next launch (2 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO4skipyA2EmF":{"name":"skip","abstract":"

    Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO4noneyA2EmF":{"name":"none","abstract":"

    Doesn’t present the alert.","parent_name":"AlertType"},"Structs/Rules.html#/s:5Siren5RulesV9alertTypeAC05AlertD0Ovp":{"name":"alertType","abstract":"

    The type of alert that should be presented.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV9frequencyAC21UpdatePromptFrequencyOvp":{"name":"frequency","abstract":"

    The frequency in which a the user is prompted to update the app","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV15promptFrequency12forAlertTypeA2C012UpdatePromptD0O_AC0fG0Otcfc":{"name":"init(promptFrequency:forAlertType:)","abstract":"

    Initializes the alert presentation rules.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV8annoyingACvpZ":{"name":"annoying","abstract":"

    Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV8criticalACvpZ":{"name":"critical","abstract":"

    Performs a version check immediately and forces the user to update the app.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV7defaultACvpZ":{"name":"default","abstract":"

    Performs a version check once a day, but allows the user to skip updating the app until","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV10persistentACvpZ":{"name":"persistent","abstract":"

    Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV7relaxedACvpZ":{"name":"relaxed","abstract":"

    Performs a version check weekly, but allows the user to skip updating the app until","parent_name":"Rules"},"Structs/Rules/AlertType.html":{"name":"AlertType","abstract":"

    Determines the type of alert to present after a successful version check has been performed.

    ","parent_name":"Rules"},"Structs/Rules/UpdatePromptFrequency.html":{"name":"UpdatePromptFrequency","abstract":"

    Determines the frequency in which the user is prompted to update the app","parent_name":"Rules"},"Structs/Results.html#/s:5Siren7ResultsV11alertActionAA05AlertD0Ovp":{"name":"alertAction","abstract":"

    The UIAlertAction the user chose upon being presented with the update alert.","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV12localizationAA12LocalizationVvp":{"name":"localization","abstract":"

    The Siren-supported locale that was used for the string in the update alert.

    ","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV11lookupModelAA06LookupD0Vvp":{"name":"lookupModel","abstract":"

    The Swift-mapped API model, if a successful version check was performed.

    ","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV10updateTypeAA12RulesManagerV06UpdateD0Ovp":{"name":"updateType","abstract":"

    The type of update that was returned for the API.

    ","parent_name":"Results"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO5appIDyA2HmF":{"name":"appID","abstract":"

    The appID JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO25currentVersionReleaseDateyA2HmF":{"name":"currentVersionReleaseDate","abstract":"

    The current version release date JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO16minimumOSVersionyA2HmF":{"name":"minimumOSVersion","abstract":"

    The minimum device iOS version compatibility JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO12releaseNotesyA2HmF":{"name":"releaseNotes","abstract":"

    The release notes JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO7versionyA2HmF":{"name":"version","abstract":"

    The current App Store version JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html":{"name":"CodingKeys","abstract":"

    Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV5appIDSivp":{"name":"appID","abstract":"

    The app’s App ID.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV25currentVersionReleaseDateSSvp":{"name":"currentVersionReleaseDate","abstract":"

    The release date for the latest verison of the app.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV16minimumOSVersionSSvp":{"name":"minimumOSVersion","abstract":"

    The minimum verison of iOS that the current verison of the app requires.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV12releaseNotesSSSgvp":{"name":"releaseNotes","abstract":"

    The releases notes from the latest version of the app.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV7versionSSvp":{"name":"version","abstract":"

    The latest version of the app.

    ","parent_name":"Results"},"Structs/LookupModel/CodingKeys.html#/s:5Siren11LookupModelV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO7resultsyA2FmF":{"name":"results","abstract":"

    The results JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/CodingKeys.html":{"name":"CodingKeys","abstract":"

    Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

    ","parent_name":"LookupModel"},"Structs/LookupModel.html#/s:5Siren11LookupModelV7resultsSayAC7ResultsVGvp":{"name":"results","abstract":"

    The array of results objects from the iTunes Lookup API.

    ","parent_name":"LookupModel"},"Structs/LookupModel/Results.html":{"name":"Results","abstract":"

    The Results object from the the iTunes Lookup API.

    ","parent_name":"LookupModel"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6arabicyA2EmF":{"name":"arabic","abstract":"

    Arabic Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8armenianyA2EmF":{"name":"armenian","abstract":"

    Armenian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6basqueyA2EmF":{"name":"basque","abstract":"

    Basque Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO17chineseSimplifiedyA2EmF":{"name":"chineseSimplified","abstract":"

    Simplified Chinese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18chineseTraditionalyA2EmF":{"name":"chineseTraditional","abstract":"

    Traditional Chinese Localization Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8croatianyA2EmF":{"name":"croatian","abstract":"

    Croatian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5czechyA2EmF":{"name":"czech","abstract":"

    Czech Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6danishyA2EmF":{"name":"danish","abstract":"

    Danish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5dutchyA2EmF":{"name":"dutch","abstract":"

    Dutch Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7englishyA2EmF":{"name":"english","abstract":"

    English Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8estonianyA2EmF":{"name":"estonian","abstract":"

    Estonian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7finnishyA2EmF":{"name":"finnish","abstract":"

    Finnish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6frenchyA2EmF":{"name":"french","abstract":"

    French Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6germanyA2EmF":{"name":"german","abstract":"

    German Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5greekyA2EmF":{"name":"greek","abstract":"

    Greek Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6hebrewyA2EmF":{"name":"hebrew","abstract":"

    Hebrew Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9hungarianyA2EmF":{"name":"hungarian","abstract":"

    Hungarian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10indonesianyA2EmF":{"name":"indonesian","abstract":"

    Indonesian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7italianyA2EmF":{"name":"italian","abstract":"

    Italian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8japaneseyA2EmF":{"name":"japanese","abstract":"

    Japanese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6koreanyA2EmF":{"name":"korean","abstract":"

    Korean Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7latvianyA2EmF":{"name":"latvian","abstract":"

    Latvian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10lithuanianyA2EmF":{"name":"lithuanian","abstract":"

    Lithuanian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5malayyA2EmF":{"name":"malay","abstract":"

    Malay Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9norwegianyA2EmF":{"name":"norwegian","abstract":"

    Norwegian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7persianyA2EmF":{"name":"persian","abstract":"

    Persian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18persianAfghanistanyA2EmF":{"name":"persianAfghanistan","abstract":"

    Persian (Afghanistan) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO11persianIranyA2EmF":{"name":"persianIran","abstract":"

    Persian (Iran) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6polishyA2EmF":{"name":"polish","abstract":"

    Polish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO16portugueseBrazilyA2EmF":{"name":"portugueseBrazil","abstract":"

    Brazilian Portuguese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18portuguesePortugalyA2EmF":{"name":"portuguesePortugal","abstract":"

    Portugal’s Portuguese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7russianyA2EmF":{"name":"russian","abstract":"

    Russian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO15serbianCyrillicyA2EmF":{"name":"serbianCyrillic","abstract":"

    Serbian (Cyrillic) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO12serbianLatinyA2EmF":{"name":"serbianLatin","abstract":"

    Serbian (Latin) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9slovenianyA2EmF":{"name":"slovenian","abstract":"

    Slovenian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7spanishyA2EmF":{"name":"spanish","abstract":"

    Spanish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7swedishyA2EmF":{"name":"swedish","abstract":"

    Swedish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO4thaiyA2EmF":{"name":"thai","abstract":"

    Thai Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7turkishyA2EmF":{"name":"turkish","abstract":"

    Turkish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO4urduyA2EmF":{"name":"urdu","abstract":"

    Urdu Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9ukrainianyA2EmF":{"name":"ukrainian","abstract":"

    Ukranian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10vietnameseyA2EmF":{"name":"vietnamese","abstract":"

    Vietnamese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html":{"name":"Language","abstract":"

    Determines the available languages in which the update message and alert button titles should appear.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV7appName33_2FDBEF65899237DA36B11FA5846AD0EALLSSvp":{"name":"appName","abstract":"

    The name of the app as defined by the Info.plist.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV13forceLanguage33_2FDBEF65899237DA36B11FA5846AD0EALLAC0D0OSgvp":{"name":"forceLanguage","abstract":"

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV7appName016andForceLanguageB0ACSSSg_AC0G0OSgtcfc":{"name":"init(appName:andForceLanguageLocalization:)","abstract":"

    Initializes

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV12alertMessage25forCurrentAppStoreVersionS2S_tF":{"name":"alertMessage(forCurrentAppStoreVersion:)","abstract":"

    The localized string for the UIAlertController‘s message field. .

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV10alertTitleSSyF":{"name":"alertTitle()","abstract":"

    The localized string for the UIAlertController‘s title field. .

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV19nextTimeButtonTitleSSyF":{"name":"nextTimeButtonTitle()","abstract":"

    The localized string for the Next time UIAlertAction.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV15skipButtonTitleSSyF":{"name":"skipButtonTitle()","abstract":"

    The localized string for the Skip this version UIAlertAction.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV17updateButtonTitleSSyF":{"name":"updateButtonTitle()","abstract":"

    The localized string for the Update UIAlertAction.

    ","parent_name":"Localization"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV12alertMessageSSvpZ":{"name":"alertMessage","abstract":"

    The text that conveys the message that there is an app update available

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV10alertTitleSSvpZ":{"name":"alertTitle","abstract":"

    The alert title which defaults to Update Available.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV19nextTimeButtonTitleSSvpZ":{"name":"nextTimeButtonTitle","abstract":"

    The button text that conveys the message that the user should be prompted to update next time the app launches.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV15skipButtonTitleSSvpZ":{"name":"skipButtonTitle","abstract":"

    The text that conveys the message that the the user wants to skip this verison update.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV17updateButtonTitleSSvpZ":{"name":"updateButtonTitle","abstract":"

    The button text that conveys the message that the user would like to update the app right away.

    ","parent_name":"AlertConstants"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5majoryA2EmF":{"name":"major","abstract":"

    Major release available: A.b.c.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5minoryA2EmF":{"name":"minor","abstract":"

    Minor release available: a.B.c.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5patchyA2EmF":{"name":"patch","abstract":"

    Patch release available: a.b.C.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO8revisionyA2EmF":{"name":"revision","abstract":"

    Revision release available: a.b.c.D

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO7unknownyA2EmF":{"name":"unknown","abstract":"

    No information available about the update.

    ","parent_name":"UpdateType"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV15releasedForDaysSivp":{"name":"releasedForDays","abstract":"

    The alert will only show up if the current version has already been released for X days.

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011majorUpdateB0AA0B0Vvp":{"name":"majorUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a major version update (A.b.c.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011minorUpdateB0AA0B0Vvp":{"name":"minorUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a minor version update (a.B.c.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011patchUpdateB0AA0B0Vvp":{"name":"patchUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a patch version update (a.b.C.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV014revisionUpdateB0AA0B0Vvp":{"name":"revisionUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a revision version update (a.b.c.D).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011majorUpdateB005minoreB005patcheB008revisioneB050showAlertAfterCurrentVersionHasBeenReleasedForDaysAcA0B0V_A3JSitcfc":{"name":"init(majorUpdateRules:minorUpdateRules:patchUpdateRules:revisionUpdateRules:showAlertAfterCurrentVersionHasBeenReleasedForDays:)","abstract":"

    Initializer that sets update-specific Rules for all updates (e.g., major, minor, patch, revision).","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV06globalB050showAlertAfterCurrentVersionHasBeenReleasedForDaysAcA0B0V_Sitcfc":{"name":"init(globalRules:showAlertAfterCurrentVersionHasBeenReleasedForDays:)","abstract":"

    Initializer that sets the same update Rules for all types of updates (e.g., major, minor, patch, revision).","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV04loadB13ForUpdateTypeyAA0B0VAC0fG0OF":{"name":"loadRulesForUpdateType(_:)","abstract":"

    Returns the appropriate update rules based on the type of version that is returned from the API.

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default RulesManager.

    ","parent_name":"RulesManager"},"Structs/RulesManager/UpdateType.html":{"name":"UpdateType","abstract":"

    Informs Siren of the type of update that is available so that","parent_name":"RulesManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17CompletionHandlera":{"name":"CompletionHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12localizationAA12LocalizationVvp":{"name":"localization","abstract":"

    The localization data structure that will be used to construct localized strings for the update alert.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV9tintColorSo7UIColorCSgvp":{"name":"tintColor","abstract":"

    The tint color of the UIAlertController buttons.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12alertMessageSSvp":{"name":"alertMessage","abstract":"

    The descriptive update message of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV10alertTitleSSvp":{"name":"alertTitle","abstract":"

    The main message of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV19nextTimeButtonTitleSSvp":{"name":"nextTimeButtonTitle","abstract":"

    The Next time button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15skipButtonTitleSSvp":{"name":"skipButtonTitle","abstract":"

    The Skip this version button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17updateButtonTitleSSvp":{"name":"updateButtonTitle","abstract":"

    The Update button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15alertController33_CEF2109017F934DAB33AED8753BA096CLLSo07UIAlertE0CSgvp":{"name":"alertController","abstract":"

    The instance of the UIAlertController used to present the update alert.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV13updaterWindow33_CEF2109017F934DAB33AED8753BA096CLLSo8UIWindowCvp":{"name":"updaterWindow","abstract":"

    The UIWindow instance that presents the SirenViewController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV14alertTintColor7appName0D5Title0D7Message012updateButtonI008nextTimelI004skiplI025forceLanguageLocalizationACSo7UIColorCSg_SSSgS5SAA0R0V0Q0OSgtcfc":{"name":"init(alertTintColor:appName:alertTitle:alertMessage:updateButtonTitle:nextTimeButtonTitle:skipButtonTitle:forceLanguageLocalization:)","abstract":"

    PresentationManager‘s public initializer.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default PresentationManager.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12presentAlert9withRules25forCurrentAppStoreVersion10completionyAA0G0V_SSyAA0E6ActionOcSgtF":{"name":"presentAlert(withRules:forCurrentAppStoreVersion:completion:)","abstract":"

    Constructs the localized update alert UIAlertController object.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17updateAlertAction33_CEF2109017F934DAB33AED8753BA096CLL10completionSo07UIAlertF0CyAA0eF0OcSg_tF":{"name":"updateAlertAction(completion:)","abstract":"

    The UIAlertAction that is executed when the Update option is selected.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV19nextTimeAlertAction33_CEF2109017F934DAB33AED8753BA096CLL10completionSo07UIAlertG0CyAA0fG0OcSg_tF":{"name":"nextTimeAlertAction(completion:)","abstract":"

    The UIAlertAction that is executed when the Next time option is selected.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15skipAlertAction33_CEF2109017F934DAB33AED8753BA096CLL25forCurrentAppStoreVersion10completionSo07UIAlertF0CSS_yAA0eF0OcSgtF":{"name":"skipAlertAction(forCurrentAppStoreVersion:completion:)","abstract":"

    The UIAlertAction that is executed when the Skip this version option is selected.

    ","parent_name":"PresentationManager"},"Structs/APIManager/Constants.html#/s:5Siren10APIManagerV9Constants33_8071139324B24E2065F4037045A8D960LLV8bundleIDSSvpZ":{"name":"bundleID","abstract":"

    Constant for the bundleId parameter in the iTunes Lookup API request.

    ","parent_name":"Constants"},"Structs/APIManager/Constants.html#/s:5Siren10APIManagerV9Constants33_8071139324B24E2065F4037045A8D960LLV7countrySSvpZ":{"name":"country","abstract":"

    Constant for the country parameter in the iTunes Lookup API request.

    ","parent_name":"Constants"},"Structs/APIManager/Constants.html":{"name":"Constants","abstract":"

    Constants used in the APIManager.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV17CompletionHandlera":{"name":"CompletionHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV11countryCodeSSSgvp":{"name":"countryCode","abstract":"

    The region or country of an App Store in which the app is available.","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV11countryCodeACSSSg_tcfc":{"name":"init(countryCode:)","abstract":"

    Initializes APIManager to the region or country of an App Store in which the app is available.","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default APIManager.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV26performVersionCheckRequest10completionyyAA11LookupModelVSg_AA10KnownErrorOSgtcSg_tF":{"name":"performVersionCheckRequest(completion:)","abstract":"

    Creates and performs a URLRequest against the iTunes Lookup API.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV26processVersionCheckResults33_8071139324B24E2065F4037045A8D960LL8withData8response5error10completiony10Foundation0M0VSg_So13NSURLResponseCSgs5Error_pSgyAA11LookupModelVSg_AA05KnownS0OSgtcSgtF":{"name":"processVersionCheckResults(withData:response:error:completion:)","abstract":"

    Parses and maps the the results from the iTunes Lookup API request.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV13makeITunesURL33_8071139324B24E2065F4037045A8D960LL10Foundation0E0VyKF":{"name":"makeITunesURL()","abstract":"

    Creates the URL that points to the iTunes Lookup API.

    ","parent_name":"APIManager"},"Structs/APIManager.html":{"name":"APIManager","abstract":"

    APIManager for Siren

    "},"Structs/PresentationManager.html":{"name":"PresentationManager","abstract":"

    PresentationManager for Siren

    "},"Structs/RulesManager.html":{"name":"RulesManager","abstract":"

    RulesManager for Siren

    "},"Structs/AlertConstants.html":{"name":"AlertConstants","abstract":"

    The default constants used for the update alert’s messaging.

    "},"Structs/Localization.html":{"name":"Localization","abstract":"

    Localization information and strings for Siren.

    "},"Structs/LookupModel.html":{"name":"LookupModel","abstract":"

    Model representing a selection of results from the iTunes Lookup API.

    "},"Structs/Results.html":{"name":"Results","abstract":"

    The relevant metadata returned from Siren upon completing a successful version check.

    "},"Structs/Rules.html":{"name":"Rules","abstract":"

    Alert Presentation Rules for Siren.

    "},"Structs/DataParser.html":{"name":"DataParser","abstract":"

    Version parsing functions for Siren.

    "},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO37PerformVersionCheckOnSubsequentLaunchyA2FmF":{"name":"PerformVersionCheckOnSubsequentLaunch","abstract":"

    Key that notifies Siren to perform a version check and present","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO22StoredVersionCheckDateyA2FmF":{"name":"StoredVersionCheckDate","abstract":"

    Key that stores the timestamp of the last version check.

    ","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO20StoredSkippedVersionyA2FmF":{"name":"StoredSkippedVersion","abstract":"

    Key that stores the version that a user decided to skip.

    ","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html":{"name":"SirenKeys","abstract":"

    Siren-specific UserDefaults Keys

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE43shouldPerformVersionCheckOnSubsequentLaunchSbvpZ":{"name":"shouldPerformVersionCheckOnSubsequentLaunch","abstract":"

    Sets and Gets a UserDefault around performing a version check on a subsequent launch.

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE20storedSkippedVersionSSSgvpZ":{"name":"storedSkippedVersion","abstract":"

    Sets and Gets a UserDefault around storing a version that the user wants to skip updating.

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE21alertPresentationDate10Foundation0F0VSgvpZ":{"name":"alertPresentationDate","abstract":"

    Sets and Gets a UserDefault around the last time the user was presented a version update alert.

    ","parent_name":"UserDefaults"},"Extensions/UIAlertController.html#/s:So17UIAlertControllerC5SirenE4show6windowySo8UIWindowC_tF":{"name":"show(window:)","abstract":"

    Presents Siren’s UIAlertController in a new UIWindow.

    ","parent_name":"UIAlertController"},"Extensions/UIAlertController.html#/s:So17UIAlertControllerC5SirenE4hide6windowySo8UIWindowC_tF":{"name":"hide(window:)","abstract":"

    Hides Siren’s UIAlertController within a given window.

    ","parent_name":"UIAlertController"},"Extensions/Date.html#/s:10Foundation4DateV5SirenE4days5sinceSiAC_tFZ":{"name":"days(since:)","abstract":"

    The amount of days passed from a specific source date.

    ","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV5SirenE4days5sinceSiSgSS_tFZ":{"name":"days(since:)","abstract":"

    The amount of days passed from a specific source date string.

    ","parent_name":"Date"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV15bundleExtensionSSvpZ":{"name":"bundleExtension","abstract":"

    Constant for the .bundle file extension.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV11displayNameSSvpZ":{"name":"displayName","abstract":"

    Constant for CFBundleDisplayName.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV19englishLocalizationSSvpZ":{"name":"englishLocalization","abstract":"

    Constant for the default US English localization.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV16projectExtensionSSvpZ":{"name":"projectExtension","abstract":"

    Constant for the project file extension.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV18shortVersionStringSSvpZ":{"name":"shortVersionString","abstract":"

    Constant for CFBundleShortVersionString.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV5tableSSvpZ":{"name":"table","abstract":"

    Constant for the localization table.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html":{"name":"Constants","abstract":"

    Constants used in the Bundle extension.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE7versionSSSgyFZ":{"name":"version()","abstract":"

    Fetches the current verison of the app.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE15localizedString6forKey20andForceLocalizationS2S_AC0I0V8LanguageOSgtFZ":{"name":"localizedString(forKey:andForceLocalization:)","abstract":"

    Returns the localized string for a given default string.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE19bestMatchingAppNameSSyFZ":{"name":"bestMatchingAppName()","abstract":"

    The appropriate name for the app to be displayed in the update alert.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE15sirenBundlePath33_9C775CF4CEC7A5F21E625F58C71BDF22LLSSSgyFZ":{"name":"sirenBundlePath()","abstract":"

    The path to Siren’s localization Bundle.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE21sirenForcedBundlePath33_9C775CF4CEC7A5F21E625F58C71BDF22LL25forceLanguageLocalizationSSSgAC0R0V0Q0O_tFZ":{"name":"sirenForcedBundlePath(forceLanguageLocalization:)","abstract":"

    The path for a particular language localizationin Siren’s localization Bundle.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE14deviceLanguage33_9C775CF4CEC7A5F21E625F58C71BDF22LLAC12LocalizationV0D0OSgyFZ":{"name":"deviceLanguage()","abstract":"

    The user’s preferred language based on their device’s localization.

    ","parent_name":"Bundle"},"Extensions/Bundle.html":{"name":"Bundle"},"Extensions/Date.html":{"name":"Date"},"Extensions/UIAlertController.html":{"name":"UIAlertController"},"Extensions/UserDefaults.html":{"name":"UserDefaults"},"Enums/KnownError.html#/s:5Siren10KnownErrorO20appStoreAppIDFailureyA2CmF":{"name":"appStoreAppIDFailure","abstract":"

    Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO33appStoreDataRetrievalEmptyResultsyA2CmF":{"name":"appStoreDataRetrievalEmptyResults","abstract":"

    Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO28appStoreDataRetrievalFailureyACs0C0_pSg_tcACmF":{"name":"appStoreDataRetrievalFailure(underlyingError:)","abstract":"

    Error retrieving App Store data as an error was returned.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO26appStoreJSONParsingFailureyACs0C0_p_tcACmF":{"name":"appStoreJSONParsingFailure(underlyingError:)","abstract":"

    Error parsing App Store JSON data.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO28appStoreOSVersionUnsupportedyA2CmF":{"name":"appStoreOSVersionUnsupported","abstract":"

    The version of iOS on the device is lower than that of the one required by the app verison update.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO27appStoreVersionArrayFailureyA2CmF":{"name":"appStoreVersionArrayFailure","abstract":"

    Error retrieving App Store verson number as the JSON does not contain a version key.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO25currentVersionReleaseDateyA2CmF":{"name":"currentVersionReleaseDate","abstract":"

    The currentVersionReleaseDate key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO12malformedURLyA2CmF":{"name":"malformedURL","abstract":"

    One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO15missingBundleIDyA2CmF":{"name":"missingBundleID","abstract":"

    Please make sure that you have set a Bundle Identifier in your project.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO17noUpdateAvailableyA2CmF":{"name":"noUpdateAvailable","abstract":"

    No new update available.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO16recentlyPromptedyA2CmF":{"name":"recentlyPrompted","abstract":"

    Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the UpdatePromptFrequency.immediately rule in RulesManager

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO15releasedTooSoonyACSi_SitcACmF":{"name":"releasedTooSoon(daysSinceRelease:releasedForDays:)","abstract":"

    The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO17skipVersionUpdateyACSS_SStcACmF":{"name":"skipVersionUpdate(installedVersion:appStoreVersion:)","abstract":"

    The user has opted to skip updating their current version of the app to the current App Store version.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"

    The localized description for each error handled by Siren.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO05sirenC033_B3C911EAD28C83CC211C07566B0F499ALLSSvpZ":{"name":"sirenError","abstract":"

    An easily identifiable prefix for all errors thrown by Siren.

    ","parent_name":"KnownError"},"Enums/AlertAction.html#/s:5Siren11AlertActionO8appStoreyA2CmF":{"name":"appStore","abstract":"

    The user clicked on the Update option, which took them to the app’s App Store page.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO8nextTimeyA2CmF":{"name":"nextTime","abstract":"

    The user clicked on the Next Time option, which dismissed the alert.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO4skipyA2CmF":{"name":"skip","abstract":"

    The user clicked on the Skip this version option, which dismissed the alert.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO7unknownyA2CmF":{"name":"unknown","abstract":"

    (Default) The user never chose an option. This is returned when an error is thrown by Siren.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html":{"name":"AlertAction","abstract":"

    The UIAlertController button that was pressed upon being presented an update alert.

    "},"Enums/KnownError.html":{"name":"KnownError","abstract":"

    Enumerates all potentials errors that Siren can handle.

    "},"Classes/SirenViewController.html#/c:@M@Siren@objc(cs)SirenViewController(py)preferredStatusBarStyle":{"name":"preferredStatusBarStyle","abstract":"

    UIStatusBarStyle override.

    ","parent_name":"SirenViewController"},"Classes/Siren.html#/s:5SirenAAC14ResultsHandlera":{"name":"ResultsHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC6sharedABvpZ":{"name":"shared","abstract":"

    The Siren singleton. The main point of entry to the Siren library.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12debugEnabledSbvp":{"name":"debugEnabled","abstract":"

    The debug flag, which is disabled by default.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC10apiManagerAA10APIManagerVvp":{"name":"apiManager","abstract":"

    The manager that controls the App Store API that is","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC19presentationManagerAA012PresentationC0Vvp":{"name":"presentationManager","abstract":"

    The manager that controls the update alert’s string localization and tint color.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12rulesManagerAA05RulesC0Vvp":{"name":"rulesManager","abstract":"

    The manager that controls the type of alert that should be displayed","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23currentInstalledVersionSSSgvp":{"name":"currentInstalledVersion","abstract":"

    The current installed version of your app.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23didBecomeActiveObserverSo8NSObject_pSgvp":{"name":"didBecomeActiveObserver","abstract":"

    The retained NotificationCenter observer that listens for UIApplication.didBecomeActiveNotification notifications.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC21alertPresentationDate33_7DFB1BC200A6C64FBED860A3A8153B65LL10Foundation0D0VSgvp":{"name":"alertPresentationDate","abstract":"

    The last date that an alert was presented to the user.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC5appID33_7DFB1BC200A6C64FBED860A3A8153B65LLSiSgvp":{"name":"appID","abstract":"

    The App Store’s unique identifier for an app.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14resultsHandler33_7DFB1BC200A6C64FBED860A3A8153B65LLyAA7ResultsVSg_AA10KnownErrorOSgtcSgvp":{"name":"resultsHandler","abstract":"

    The completion handler used to return the results or errors returned by Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/c:@M@Siren@objc(cs)Siren(im)init":{"name":"init()","abstract":"

    The initialization method.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC4wail10completionyyAA7ResultsVSg_AA10KnownErrorOSgtcSg_tF":{"name":"wail(completion:)","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14launchAppStoreyyF":{"name":"launchAppStore()","abstract":"

    Launches the AppStore in two situations when the user clicked the Update button in the UIAlertController modal.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC19performVersionCheckyyF":{"name":"performVersionCheck()","abstract":"

    Initiates the uni-directional version checking flow.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC8validate5modelyAA11LookupModelV_tF":{"name":"validate(model:)","abstract":"

    Validates the parsed and mapped iTunes Lookup Model","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC45determineIfAlertPresentationRulesAreSatisfied25forCurrentAppStoreVersion14andLookupModelySS_AA0oP0VtF":{"name":"determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion:andLookupModel:)","abstract":"

    Determines if the update alert can be presented based on the","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12presentAlert9withRules25forCurrentAppStoreVersion5model13andUpdateTypeyAA0E0V_SSAA11LookupModelVAA0E7ManagerV0mN0OtF":{"name":"presentAlert(withRules:forCurrentAppStoreVersion:model:andUpdateType:)","abstract":"

    Presents the update alert to the end user.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12addObserversyyF":{"name":"addObservers()","abstract":"

    Add an observer that listens for app launching/relaunching","parent_name":"Siren"},"Classes/Siren.html":{"name":"Siren","abstract":"

    The Siren Class.

    "},"Classes/SirenViewController.html":{"name":"SirenViewController","abstract":"

    UIViewController Extension for Siren

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "}} \ No newline at end of file diff --git a/docs/docsets/Siren.docset/Contents/Resources/docSet.dsidx b/docs/docsets/Siren.docset/Contents/Resources/docSet.dsidx index fe48f3d3..0faea670 100644 Binary files a/docs/docsets/Siren.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/Siren.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/Siren.tgz b/docs/docsets/Siren.tgz index 8a4a7eb0..03d21a01 100644 Binary files a/docs/docsets/Siren.tgz and b/docs/docsets/Siren.tgz differ diff --git a/docs/index.html b/docs/index.html index 86a7956d..8a84d714 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,13 +33,7 @@ Siren - - @@ -47,15 +41,33 @@ Enumerations @@ -63,22 +75,52 @@ Structures @@ -101,16 +143,15 @@

    Table of Contents

  • Features
  • Screenshots
  • Installation Instructions
  • -
  • Example Code
  • -
  • Granular/Differentiated Version Management
  • -
  • Delegates (Optional)
  • +
  • Implementation Examples
  • Localization
  • Device Compatibility
  • Testing Siren
  • App Store Review & Submissions
  • -
  • Phrased Releases
  • +
  • Phased Releases
  • Words of Caution
  • Ports
  • +
  • Shout-Out and Gratitude
  • Attribution
  • @@ -125,28 +166,27 @@

    About

  • Siren is built to work with the Semantic Versioning system.
      -
    • Semantic Versioning is a three number versioning system (e.g., 1.0.0)
    • +
    • Canonical Semantic Versioning uses a three number versioning system (e.g., 1.0.0)
    • Siren also supports two-number versioning (e.g., 1.0) and four-number versioning (e.g., 1.0.0.0)
  • -
  • Siren is actively maintained by Arthur Sabintsev and Aaron Brager
  • -

    README Translations

    +

    Features

    +

    Current Features

    -

    Features

    +

    Future Features

      -
    • [x] CocoaPods Support
    • -
    • [x] Carthage Support
    • -
    • [x] Swift Package Manager Support
    • -
    • [x] Localized for 30+ languages (see Localization)
    • -
    • [x] Pre-Update Device Compatibility Check (see Device Compatibility)
    • -
    • [x] Three types of alerts (see Screenshots)
    • -
    • [x] Optional delegate methods (see Delegates (Optional))
    • -
    • [x] Unit Tests
    • -
    • [x] Documentation can be found at http://sabintsev.com/Siren.
    • +
    • [ ] Present prompt only on WiFi if app is over the OTA limit.
    • +
    • [ ] Support for Third-/Homegrown Update Servers (not including TestFlight).
    • +
    • [ ] Increase code coverage with more unit tests and UI tests.

    Screenshots

    @@ -154,7 +194,7 @@

    Screenshots

  • The left picture forces the user to update the app.
  • The center picture gives the user the option to update the app.
  • The right picture gives the user the option to skip the current update.
  • -
  • These options are controlled by the Siren.AlertType enum.
  • +
  • These options are controlled by the Rules.AlertType enum.
  • @@ -202,196 +242,56 @@

    CocoaPods

    Carthage

    github "ArtSabintsev/Siren" // Swift 4.2
    -github "ArtSabintsev/Siren", "swift4.1" // Swift 4.1
    -github "ArtSabintsev/Siren", "swift3.2" // Swift 3.2
    -github "ArtSabintsev/Siren", "swift3.1" // Swift 3.1
    -github "ArtSabintsev/Siren", "swift2.3" // Swift 2.3
    +github "ArtSabintsev/Siren" "swift4.1" // Swift 4.1
    +github "ArtSabintsev/Siren" "swift3.2" // Swift 3.2
    +github "ArtSabintsev/Siren" "swift3.1" // Swift 3.1
    +github "ArtSabintsev/Siren" "swift2.3" // Swift 2.3
     

    Swift Package Manager

    -
    .Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 3)
    +
    .Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 4)
     
    -

    Example Code

    - -

    Below is some commented sample code. Adapt this to meet your app’s needs.

    - -

    For a full list of optional settings/preferences, please refer to https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift in the Sample Project.

    -
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    -    /* Siren code should go below window?.makeKeyAndVisible() */
    +

    Implementation Examples

    - // Siren is a singleton - let siren = Siren.shared +

    Implementing Siren is as easy as adding two line of code to your app.

    +
    import Siren // Line 1
    +import UIKit
     
    -    // Optional: Defaults to .option
    -    siren.alertType = <#Siren.AlertType_Enum_Value#>
    +@UIApplicationMain
    +final class AppDelegate: UIResponder, UIApplicationDelegate {
    +    var window: UIWindow?
     
    -    // Optional: Change the various UIAlertController and UIAlertAction messaging. One or more values can be changes. If only a subset of values are changed, the defaults with which Siren comes with will be used.
    -    siren.alertMessaging = SirenAlertMessaging(updateTitle: NSAttributedString(string: "New Fancy Title"),
    -                                                updateMessage: NSAttributedString(string: "New message goes here!"),
    -                                                updateButtonMessage: NSAttributedString(string: "Update Now, Plz!?"),
    -                                                nextTimeButtonMessage: NSAttributedString(string: "OK, next time it is!"),
    -                                                skipVersionButtonMessage: NSAttributedString(string: "Please don't push skip, please don't!"))
    +    func application(_ application: UIApplication,
    +                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    +        window?.makeKeyAndVisible()
     
    +        Siren.shared.wail() // Line 2
     
    -    // Optional: Set this variable if you would only like to show an alert if your app has been available on the store for a few days.
    -    // This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution
    -    // To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution.
    -    siren.showAlertAfterCurrentVersionHasBeenReleasedForDays = 3
    -
    -    // Replace .immediately with .daily or .weekly to specify a maximum daily or weekly frequency for version checks.
    -    // DO NOT CALL THIS METHOD IN didFinishLaunchingWithOptions IF YOU ALSO PLAN TO CALL IT IN applicationDidBecomeActive.
    -    siren.checkVersion(checkType: .immediately)
    -
    -    return true
    -}
    -
    -func applicationDidBecomeActive(application: UIApplication) {
    -    /*
    -        Perform daily (.daily) or weekly (.weekly) checks for new version of your app.
    -        Useful if user returns to your app from the background after extended period of time.
    -            Place in applicationDidBecomeActive(_:).
    -     */
    -
    -    Siren.shared.checkVersion(checkType: .daily)
    -}
    -
    -func applicationWillEnterForeground(application: UIApplication) {
    -   /*
    -      Useful if user returns to your app from the background after being sent to the
    -      App Store, but doesn't update their app before coming back to your app.
    -
    -      ONLY USE WITH Siren.AlertType.immediately
    -   */
    -
    -    Siren.shared.checkVersion(checkType: .immediately)
    -}
    -
    - -

    And you’re all set!

    -

    Prompting for Updates without Alerts

    - -

    Some developers may want to display a less obtrusive custom interface, like a banner or small icon. To accomplish this, you can disable alert presentation by doing the following:

    -
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    -    ...
    -    siren.delegate = self
    -    siren.alertType = .none
    -    ...
    -}
    -
    -extension AppDelegate: SirenDelegate {
    -    // Returns a localized message to this delegate method upon performing a successful version check
    -    func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType) {
    -        print("\(message)")
    +        return true
         }
     }
     
    -

    Siren will call the sirenDidDetectNewVersionWithoutAlert(message: String) delegate method, passing a localized, suggested update string suitable for display. Implement this method to display your own messaging, optionally using message.

    -

    Granular Version Update Management

    +

    Siren also has plenty of customization options. All examples can be found in the Example Project’s AppDelegate file. Uncomment the example you’d like to test.

    -

    If you would like to set a different type of alert for revision, patch, minor, and/or major updates, simply add one or all of the following optional lines to your setup before calling the checkVersion() method:

    -
        /* Siren defaults to Siren.AlertType.option for all updates */
    -    siren.shared.revisionUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.patchUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.minorUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -    siren.shared.majorUpdateAlertType = <#Siren.AlertType_Enum_Value#>
    -
    -

    Optional Delegate and Delegate Methods

    - -

    Six delegate methods allow you to handle or track the user’s behavior. Each method has a default, empty implementation, effectively making each of these methods optional.

    -
    public protocol SirenDelegate: NSObjectProtocol {
    -    /// Siren performed version check and did not display alert.
    -    func sirenDidDetectNewVersionWithoutAlert(message: String, updateType: UpdateType)
    -
    -    /// Siren failed to perform version check.
    -    ///
    -    /// - Note:
    -    ///     Depending on the reason for failure,
    -    ///     a system-level error may be returned.
    -    func sirenDidFailVersionCheck(error: Error)
    -
    -    /// User presented with update dialog.
    -    func sirenDidShowUpdateDialog(alertType: Siren.AlertType)
    -
    -    /// Siren performed a version check and latest version is installed.
    -    func sirenLatestVersionInstalled()
    -
    -    /// Provides the decoded JSON information from a successful version check call.
    -    ///
    -    /// - SeeAlso:
    -    ///     SirenLookupModel.swift
    -    ///
    -    /// - Parameter lookupModel: The `Decodable` model representing the JSON results from the iTunes Lookup API.
    -    func sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel: SirenLookupModel)
    -
    -    /// User did click on button that cancels update dialog.
    -    func sirenUserDidCancel()
    -
    -    /// User did click on button that launched "App Store.app".
    -    func sirenUserDidLaunchAppStore()
    -
    -    /// User did click on button that skips version update.
    -    func sirenUserDidSkipVersion()
    -}
    -
    +

    WARNING: Siren should ONLY be placed in UIApplication.didFinishLaunchingWithOptions and only after the window?.makeKeyAndVisible() call. Siren initializes a listener on didBecomeActiveNotification to perform version checks.

    Localization

    -

    Siren is localized for

    +

    Siren is localized for the following languages:

    -
      -
    • Arabic
    • -
    • Armenian
    • -
    • Basque
    • -
    • Chinese (Simplified and Traditional)
    • -
    • Croatian
    • -
    • Czech
    • -
    • Danish
    • -
    • Dutch
    • -
    • English
    • -
    • Estonian
    • -
    • Finnish
    • -
    • French
    • -
    • German
    • -
    • Greek
    • -
    • Hebrew
    • -
    • Hungarian
    • -
    • Indonesian
    • -
    • Italian
    • -
    • Japanese
    • -
    • Korean
    • -
    • Latvian
    • -
    • Lithuanian
    • -
    • Malay
    • -
    • Norwegian (Bokmål)
    • -
    • Persian (Afghanistan, Iran, Persian)
    • -
    • Polish
    • -
    • Portuguese (Brazil and Portugal)
    • -
    • Russian
    • -
    • Serbian (Cyrillic and Latin)
    • -
    • Slovenian
    • -
    • Spanish
    • -
    • Swedish
    • -
    • Thai
    • -
    • Turkish
    • -
    • Ukrainian
    • -
    • Urdu
    • -
    • Vietnamese
    • -
    - -

    You may want the update dialog to always appear in a certain language, ignoring iOS’s language setting (e.g. apps released in a specific country).

    +

    Arabic, Armenian, Basque, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian (Bokmål), Persian (Afghanistan, Iran, Persian), Polish, Portuguese (Brazil and Portugal), Russian, Serbian (Cyrillic and Latin), Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Urdu, Vietnamese

    -

    You can enable it like so:

    -
    Siren.shared.forceLanguageLocalization = Siren.LanguageType.<#Siren.LanguageType_Enum_Value#>
    +

    You may want the update dialog to always appear in a certain language, ignoring the user’s device-specific setting. You can enable it like so:

    +
    // In this example, we force the `russian` language.
    +Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian)
     

    Device Compatibility

    -

    If an app update is available, Siren checks to make sure that the version of iOS on the user’s device is compatible with the one that is required by the app update. For example, if a user has iOS 10 installed on their device, but the app update requires iOS 11, an alert will not be shown. This takes care of the false positive case regarding app updating.

    +

    If an app update is available, Siren checks to make sure that the version of iOS on the user’s device is compatible with the one that is required by the app update. For example, if a user has iOS 11 installed on their device, but the app update requires iOS 12, an alert will not be shown. This takes care of the false positive case regarding app updating.

    Testing Siren

    -

    Temporarily change the version string in Xcode (within the .xcodeproj) to an older version than the one that’s currently available in the App Store. Afterwards, build and run your app, and you should see the alert.

    +

    Temporarily change the version string in Xcode (within the .xcodeproj file) to an older version than the one that’s currently available in the App Store. Afterwards, build and run your app, and you should see the alert.

    If you currently don’t have an app in the store, change your bundleID to one that is already in the store. In the sample app packaged with this library, we use the App Store Connect app’s bundleID: com.apple.AppStoreConnect.

    - -

    For your convenience, you may turn on debugging statements by setting self.debugEnabled = true before calling the checkVersion() method.

    App Store Submissions

    The App Store reviewer will not see the alert. The version in the App Store will always be older than the version being reviewed.

    @@ -401,7 +301,7 @@

    Phased Releases

    • You can leave Siren configured as normal. Phased rollout will continue to auto-update apps. Since all users can still manually update your app directly from the App Store, Siren will ignore the phased rollout and will prompt users to update.
    • -
    • You can set showAlertAfterCurrentVersionHasBeenReleasedForDays to 7, and Siren will not prompt any users until the latest version is 7 days old, after phased rollout is complete.
    • +
    • You can set showAlertAfterCurrentVersionHasBeenReleasedForDays to 7, and Siren will not prompt any users until the latest version is 7 days old, after the phased rollout is complete.
    • You can remotely disable Siren until the rollout is done using your own API / backend logic.

    Words of Caution

    @@ -415,6 +315,7 @@

    Ports

    • Harpy
    • Siren was ported from Harpy, as Siren and Harpy are maintained by the same developer.
    • +
    • As of December 2018, Harpy has been deprecated in favor of Siren.
  • Java (Android) @@ -429,14 +330,23 @@

    Ports

  • The Siren Swift library inspired the React Native library.
  • +

    Shout-Out and Gratitude

    + +

    A massive shout-out and thank you goes to the following folks:

    + +
      +
    • Aaron Brager for motivating me and assisting me in building the initial proof-of-concept of Siren (based on Harpy) back in 2015. Without him, Siren may never have been built.
    • +
    • All of Harpy’s Consitrbutors for helping building the feature set from 2012-2015 that was used as the basis for the first version of Siren.
    • +
    • All of Siren’s Contributors for helping make Siren as powerful and bug-free as it currently is today.
    • +

    Created and maintained by

    -

    Arthur Ariel Sabintsev & Aaron Brager

    +

    Arthur Ariel Sabintsev

    diff --git a/docs/search.json b/docs/search.json index 53596f3b..140126da 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -{"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO20appStoreAppIDFailureyA2EmF":{"name":"appStoreAppIDFailure","abstract":"

    Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO28appStoreDataRetrievalFailureyAEs0B0_pSg_tcAEmF":{"name":"appStoreDataRetrievalFailure(underlyingError:)","abstract":"

    Error retrieving App Store data as an error was returned.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO26appStoreJSONParsingFailureyAEs0B0_p_tcAEmF":{"name":"appStoreJSONParsingFailure(underlyingError:)","abstract":"

    Error parsing App Store JSON data.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO33appStoreDataRetrievalEmptyResultsyA2EmF":{"name":"appStoreDataRetrievalEmptyResults","abstract":"

    Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO30appStoreOSVersionNumberFailureyA2EmF":{"name":"appStoreOSVersionNumberFailure","abstract":"

    Error retrieving iOS version number as there was no data returned.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO28appStoreOSVersionUnsupportedyA2EmF":{"name":"appStoreOSVersionUnsupported","abstract":"

    The version of iOS on the device is lower than that of the one required by the app verison update.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO27appStoreVersionArrayFailureyA2EmF":{"name":"appStoreVersionArrayFailure","abstract":"

    Error retrieving App Store verson number as the JSON does not contain a ‘version’ key.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO12malformedURLyA2EmF":{"name":"malformedURL","abstract":"

    The iTunes URL is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO17noUpdateAvailableyA2EmF":{"name":"noUpdateAvailable","abstract":"

    No new update available.

    ","parent_name":"Known"},"Structs/SirenError/Known.html#/s:5Siren0A5ErrorV5KnownO22recentlyCheckedAlreadyyA2EmF":{"name":"recentlyCheckedAlready","abstract":"

    Not checking the version, because it was already checked recently.

    ","parent_name":"Known"},"Structs/SirenError/Known.html":{"name":"Known","abstract":"

    Enumerates all potentials errors that Siren can handle.

    ","parent_name":"SirenError"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV5appIDSivp":{"name":"appID","abstract":"

    The app’s App ID.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV25currentVersionReleaseDateSSvp":{"name":"currentVersionReleaseDate","abstract":"

    The release date for the latest verison of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV16minimumOSVersionSSvp":{"name":"minimumOSVersion","abstract":"

    The minimum verison of iOS that the current verison of the app requires.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV12releaseNotesSSSgvp":{"name":"releaseNotes","abstract":"

    The releases notes from the latest version of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel/Results.html#/s:5Siren0A11LookupModelV7ResultsV7versionSSvp":{"name":"version","abstract":"

    The latest version of the app.

    ","parent_name":"Results"},"Structs/SirenLookupModel.html#/s:5Siren0A11LookupModelV7resultsSayAC7ResultsVGvp":{"name":"results","abstract":"

    The array of results objects from the iTunes Lookup API.

    ","parent_name":"SirenLookupModel"},"Structs/SirenLookupModel/Results.html":{"name":"Results","abstract":"

    The Results object from the the iTunes Lookup API.

    ","parent_name":"SirenLookupModel"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV8nextTimeSo18NSAttributedStringCvpZ":{"name":"nextTime","abstract":"

    The button text that conveys the message that the user should be prompted to update next time the app launches.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV11skipVersionSo18NSAttributedStringCvpZ":{"name":"skipVersion","abstract":"

    The text that conveys the message that the the user wants to skip this verison update.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV13updateMessageSo18NSAttributedStringCvpZ":{"name":"updateMessage","abstract":"

    The text that conveys the message that there is an app update available

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV11updateTitleSo18NSAttributedStringCvpZ":{"name":"updateTitle","abstract":"

    The alert title which defaults to Update Available.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html#/s:5Siren0A14AlertMessagingV9ConstantsV9updateNowSo18NSAttributedStringCvpZ":{"name":"updateNow","abstract":"

    The button text that conveys the message that the user would like to update the app right away.

    ","parent_name":"Constants"},"Structs/SirenAlertMessaging/Constants.html":{"name":"Constants","abstract":"

    The default constants used for the alert messaging.

    ","parent_name":"SirenAlertMessaging"},"Structs/SirenAlertMessaging.html#/s:5Siren0A14AlertMessagingV11updateTitle0D7Message0d6ButtonF008nextTimegF0011skipVersiongF0ACSo18NSAttributedStringC_A4Jtcfc":{"name":"init(updateTitle:updateMessage:updateButtonMessage:nextTimeButtonMessage:skipVersionButtonMessage:)","abstract":"

    The public initializer

    ","parent_name":"SirenAlertMessaging"},"Structs/SirenAlertMessaging.html":{"name":"SirenAlertMessaging","abstract":"

    Allows the overriding of all the UIAlertController and UIActionSheet Strings to which Siren defaults.

    "},"Structs/SirenLookupModel.html":{"name":"SirenLookupModel","abstract":"

    MARK: Siren extension used to parse and map the iTunes JSON results into a model represented in Swift.

    "},"Structs/SirenError.html":{"name":"SirenError","abstract":"

    Data structure used to build Siren specific Errors.

    "},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP36sirenDidDetectNewVersionWithoutAlert5title7message10updateTypeySS_SSAA06UpdateM0OtF":{"name":"sirenDidDetectNewVersionWithoutAlert(title:message:updateType:)","abstract":"

    Siren performed a version check and did not display an alert.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP24sirenDidFailVersionCheck5errorys5Error_p_tF":{"name":"sirenDidFailVersionCheck(error:)","abstract":"

    Siren failed to perform version check.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP24sirenDidShowUpdateDialog9alertTypeyA2AC05AlertI0O_tF":{"name":"sirenDidShowUpdateDialog(alertType:)","abstract":"

    User presented with an update dialog.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP27sirenLatestVersionInstalledyyF":{"name":"sirenLatestVersionInstalled()","abstract":"

    Siren performed a version check and the latest version was already installed.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP50sirenNetworkCallDidReturnWithNewVersionInformation11lookupModelyAA0a6LookupM0V_tF":{"name":"sirenNetworkCallDidReturnWithNewVersionInformation(lookupModel:)","abstract":"

    Provides the decoded JSON information from a successful version check call.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP18sirenUserDidCancelyyF":{"name":"sirenUserDidCancel()","abstract":"

    User did click on button that cancels update dialog.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP26sirenUserDidLaunchAppStoreyyF":{"name":"sirenUserDidLaunchAppStore()","abstract":"

    User did click on button that launched App Store.app.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html#/s:5Siren0A8DelegateP23sirenUserDidSkipVersionyyF":{"name":"sirenUserDidSkipVersion()","abstract":"

    User did click on button that skips version update.

    ","parent_name":"SirenDelegate"},"Protocols/SirenDelegate.html":{"name":"SirenDelegate","abstract":"

    Delegate that handles all codepaths for Siren upon version check completion.

    "},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5majoryA2CmF":{"name":"major","abstract":"

    Major release available: A.b.c.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5minoryA2CmF":{"name":"minor","abstract":"

    Minor release available: a.B.c.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO5patchyA2CmF":{"name":"patch","abstract":"

    Patch release available: a.b.C.d

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO8revisionyA2CmF":{"name":"revision","abstract":"

    Revision release available: a.b.c.D

    ","parent_name":"UpdateType"},"Enums/UpdateType.html#/s:5Siren10UpdateTypeO7unknownyA2CmF":{"name":"unknown","abstract":"

    No information available about the update.

    ","parent_name":"UpdateType"},"Enums/UpdateType.html":{"name":"UpdateType","abstract":"

    MARK - Siren UpdateType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6arabicyA2DmF":{"name":"arabic","abstract":"

    Arabic

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8armenianyA2DmF":{"name":"armenian","abstract":"

    Armenian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6basqueyA2DmF":{"name":"basque","abstract":"

    Basque

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO17chineseSimplifiedyA2DmF":{"name":"chineseSimplified","abstract":"

    Simplified Chinese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18chineseTraditionalyA2DmF":{"name":"chineseTraditional","abstract":"

    Traditional Chinese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8croatianyA2DmF":{"name":"croatian","abstract":"

    Croatian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5czechyA2DmF":{"name":"czech","abstract":"

    Czech

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6danishyA2DmF":{"name":"danish","abstract":"

    Danish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5dutchyA2DmF":{"name":"dutch","abstract":"

    Dutch

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7englishyA2DmF":{"name":"english","abstract":"

    English

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8estonianyA2DmF":{"name":"estonian","abstract":"

    Estonian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7finnishyA2DmF":{"name":"finnish","abstract":"

    Finnish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6frenchyA2DmF":{"name":"french","abstract":"

    French

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6germanyA2DmF":{"name":"german","abstract":"

    German

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5greekyA2DmF":{"name":"greek","abstract":"

    Greek

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6hebrewyA2DmF":{"name":"hebrew","abstract":"

    Hebrew

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9hungarianyA2DmF":{"name":"hungarian","abstract":"

    Hungarian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10indonesianyA2DmF":{"name":"indonesian","abstract":"

    Indonesian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7italianyA2DmF":{"name":"italian","abstract":"

    Italian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO8japaneseyA2DmF":{"name":"japanese","abstract":"

    Japanese

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6koreanyA2DmF":{"name":"korean","abstract":"

    Korean

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7latvianyA2DmF":{"name":"latvian","abstract":"

    Latvian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10lithuanianyA2DmF":{"name":"lithuanian","abstract":"

    Lithuanian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO5malayyA2DmF":{"name":"malay","abstract":"

    Malaysian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9norwegianyA2DmF":{"name":"norwegian","abstract":"

    Norwegian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7persianyA2DmF":{"name":"persian","abstract":"

    Persian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18persianAfghanistanyA2DmF":{"name":"persianAfghanistan","abstract":"

    Persian (Afghanistan)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO11persianIranyA2DmF":{"name":"persianIran","abstract":"

    Persian (Iran)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO6polishyA2DmF":{"name":"polish","abstract":"

    Polish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO16portugueseBrazilyA2DmF":{"name":"portugueseBrazil","abstract":"

    Portuguese (Brazil)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO18portuguesePortugalyA2DmF":{"name":"portuguesePortugal","abstract":"

    Portuguese (Portugal)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7russianyA2DmF":{"name":"russian","abstract":"

    Russian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO15serbianCyrillicyA2DmF":{"name":"serbianCyrillic","abstract":"

    Serbian (Cyrillic)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO12serbianLatinyA2DmF":{"name":"serbianLatin","abstract":"

    Serbian (Latin)

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9slovenianyA2DmF":{"name":"slovenian","abstract":"

    Slovenian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7spanishyA2DmF":{"name":"spanish","abstract":"

    Spanish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7swedishyA2DmF":{"name":"swedish","abstract":"

    Swedish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO4thaiyA2DmF":{"name":"thai","abstract":"

    Thai

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO7turkishyA2DmF":{"name":"turkish","abstract":"

    Turkish

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO4urduyA2DmF":{"name":"urdu","abstract":"

    Urdu

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO9ukrainianyA2DmF":{"name":"ukrainian","abstract":"

    Ukranian

    ","parent_name":"LanguageType"},"Classes/Siren/LanguageType.html#/s:5SirenAAC12LanguageTypeO10vietnameseyA2DmF":{"name":"vietnamese","abstract":"

    Vietnamese

    ","parent_name":"LanguageType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO11immediatelyyA2DmF":{"name":"immediately","abstract":"

    Version check performed every time the app is launched.

    ","parent_name":"VersionCheckType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO5dailyyA2DmF":{"name":"daily","abstract":"

    Version check performed once a day.

    ","parent_name":"VersionCheckType"},"Classes/Siren/VersionCheckType.html#/s:5SirenAAC16VersionCheckTypeO6weeklyyA2DmF":{"name":"weekly","abstract":"

    Version check performed once a week.

    ","parent_name":"VersionCheckType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO5forceyA2DmF":{"name":"force","abstract":"

    Forces user to update your app (1 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO6optionyA2DmF":{"name":"option","abstract":"

    (DEFAULT) Presents user with option to update app now or at next launch (2 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO4skipyA2DmF":{"name":"skip","abstract":"

    Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

    ","parent_name":"AlertType"},"Classes/Siren/AlertType.html#/s:5SirenAAC9AlertTypeO4noneyA2DmF":{"name":"none","abstract":"

    Doesn’t show the alert, but instead returns a localized message","parent_name":"AlertType"},"Classes/Siren.html#/s:5SirenAAC0A11ErrorDomainSSvp":{"name":"SirenErrorDomain","abstract":"

    The error domain for all errors created by Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC8delegateAA0A8Delegate_pSgXwvp":{"name":"delegate","abstract":"

    The SirenDelegate variable, which should be set if you’d like to be notified of any of specific user interactions or API success/failures.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12debugEnabledSbvp":{"name":"debugEnabled","abstract":"

    The debug flag, which is disabled by default.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC9alertTypeAB05AlertC0Ovp":{"name":"alertType","abstract":"

    Determines the type of alert that should be shown.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20majorUpdateAlertTypeAB0dE0Ovp":{"name":"majorUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for major version updates: A.b.c","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20minorUpdateAlertTypeAB0dE0Ovp":{"name":"minorUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for minor version updates: a.B.c","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC20patchUpdateAlertTypeAB0dE0Ovp":{"name":"patchUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for minor patch updates: a.b.C","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23revisionUpdateAlertTypeAB0dE0Ovp":{"name":"revisionUpdateAlertType","abstract":"

    Determines the type of alert that should be shown for revision updates: a.b.c.D","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC7appNameSSvp":{"name":"appName","abstract":"

    The name of your app.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14alertMessagingAA0a5AlertC0Vvp":{"name":"alertMessaging","abstract":"

    Overrides all the Strings to which Siren defaults.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC11countryCodeSSSgvp":{"name":"countryCode","abstract":"

    The region or country of an App Store in which your app is available.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC25forceLanguageLocalizationAB0C4TypeOSgvp":{"name":"forceLanguageLocalization","abstract":"

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC24alertControllerTintColorSo7UIColorCSgvp":{"name":"alertControllerTintColor","abstract":"

    Overrides the tint color for UIAlertController.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC50showAlertAfterCurrentVersionHasBeenReleasedForDaysSivp":{"name":"showAlertAfterCurrentVersionHasBeenReleasedForDays","abstract":"

    When this is set, the alert will only show up if the current version has already been released for X days.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC22currentAppStoreVersionSSSgvp":{"name":"currentAppStoreVersion","abstract":"

    The current version of your app that is available for download on the App Store

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC6sharedABvpZ":{"name":"shared","abstract":"

    The App’s Singleton

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12checkVersion0B4TypeyAB0c5CheckD0O_tF":{"name":"checkVersion(checkType:)","abstract":"

    Checks the currently installed version of your app against the App Store.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14launchAppStoreyyF":{"name":"launchAppStore()","abstract":"

    Launches the AppStore in two situations:

    ","parent_name":"Siren"},"Classes/Siren/AlertType.html":{"name":"AlertType","abstract":"

    Determines the type of alert to present after a successful version check has been performed.

    ","parent_name":"Siren"},"Classes/Siren/VersionCheckType.html":{"name":"VersionCheckType","abstract":"

    Determines the frequency in which the the version check is performed and the user is prompted to update the app.

    ","parent_name":"Siren"},"Classes/Siren/LanguageType.html":{"name":"LanguageType","abstract":"

    Determines the available languages in which the update message and alert button titles should appear.

    ","parent_name":"Siren"},"Classes/Siren.html":{"name":"Siren","abstract":"

    The Siren Class. A singleton that is initialized using the shared constant.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "}} \ No newline at end of file +{"Structs/DataParser.html#/s:5Siren10DataParserV22isAppStoreVersionNewer09installedG003appfG0SbSSSg_AGtFZ":{"name":"isAppStoreVersionNewer(installedVersion:appStoreVersion:)","abstract":"

    Checks to see if the App Store version of the app is newer than the installed version.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV30isUpdateCompatibleWithDeviceOS3forSbAA11LookupModelV_tFZ":{"name":"isUpdateCompatibleWithDeviceOS(for:)","abstract":"

    Validates that the latest version in the App Store is compatible with the device’s current version of iOS.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV14parseForUpdate19forInstalledVersion011andAppStoreI0AA12RulesManagerV0F4TypeOSSSg_AKtFZ":{"name":"parseForUpdate(forInstalledVersion:andAppStoreVersion:)","abstract":"

    The type of update that is returned from the API in relation to the verison of the app that is installed.

    ","parent_name":"DataParser"},"Structs/DataParser.html#/s:5Siren10DataParserV5split33_35354280B893AD05C0C27D0AD925B30FLL7versionSaySiGSS_tFZ":{"name":"split(version:)","abstract":"

    Splits a version-formatted String into an[Int]`.

    ","parent_name":"DataParser"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO11immediatelyyA2EmF":{"name":"immediately","abstract":"

    Version check performed every time the app is launched.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO5dailyyA2EmF":{"name":"daily","abstract":"

    Version check performed once a day.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/UpdatePromptFrequency.html#/s:5Siren5RulesV21UpdatePromptFrequencyO6weeklyyA2EmF":{"name":"weekly","abstract":"

    Version check performed once a week.

    ","parent_name":"UpdatePromptFrequency"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO5forceyA2EmF":{"name":"force","abstract":"

    Forces the user to update your app (1 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO6optionyA2EmF":{"name":"option","abstract":"

    Presents the user with option to update app now or at next launch (2 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO4skipyA2EmF":{"name":"skip","abstract":"

    Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert).

    ","parent_name":"AlertType"},"Structs/Rules/AlertType.html#/s:5Siren5RulesV9AlertTypeO4noneyA2EmF":{"name":"none","abstract":"

    Doesn’t present the alert.","parent_name":"AlertType"},"Structs/Rules.html#/s:5Siren5RulesV9alertTypeAC05AlertD0Ovp":{"name":"alertType","abstract":"

    The type of alert that should be presented.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV9frequencyAC21UpdatePromptFrequencyOvp":{"name":"frequency","abstract":"

    The frequency in which a the user is prompted to update the app","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV15promptFrequency12forAlertTypeA2C012UpdatePromptD0O_AC0fG0Otcfc":{"name":"init(promptFrequency:forAlertType:)","abstract":"

    Initializes the alert presentation rules.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV8annoyingACvpZ":{"name":"annoying","abstract":"

    Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV8criticalACvpZ":{"name":"critical","abstract":"

    Performs a version check immediately and forces the user to update the app.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV7defaultACvpZ":{"name":"default","abstract":"

    Performs a version check once a day, but allows the user to skip updating the app until","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV10persistentACvpZ":{"name":"persistent","abstract":"

    Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active.

    ","parent_name":"Rules"},"Structs/Rules.html#/s:5Siren5RulesV7relaxedACvpZ":{"name":"relaxed","abstract":"

    Performs a version check weekly, but allows the user to skip updating the app until","parent_name":"Rules"},"Structs/Rules/AlertType.html":{"name":"AlertType","abstract":"

    Determines the type of alert to present after a successful version check has been performed.

    ","parent_name":"Rules"},"Structs/Rules/UpdatePromptFrequency.html":{"name":"UpdatePromptFrequency","abstract":"

    Determines the frequency in which the user is prompted to update the app","parent_name":"Rules"},"Structs/Results.html#/s:5Siren7ResultsV11alertActionAA05AlertD0Ovp":{"name":"alertAction","abstract":"

    The UIAlertAction the user chose upon being presented with the update alert.","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV12localizationAA12LocalizationVvp":{"name":"localization","abstract":"

    The Siren-supported locale that was used for the string in the update alert.

    ","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV11lookupModelAA06LookupD0Vvp":{"name":"lookupModel","abstract":"

    The Swift-mapped API model, if a successful version check was performed.

    ","parent_name":"Results"},"Structs/Results.html#/s:5Siren7ResultsV10updateTypeAA12RulesManagerV06UpdateD0Ovp":{"name":"updateType","abstract":"

    The type of update that was returned for the API.

    ","parent_name":"Results"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO5appIDyA2HmF":{"name":"appID","abstract":"

    The appID JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO25currentVersionReleaseDateyA2HmF":{"name":"currentVersionReleaseDate","abstract":"

    The current version release date JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO16minimumOSVersionyA2HmF":{"name":"minimumOSVersion","abstract":"

    The minimum device iOS version compatibility JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO12releaseNotesyA2HmF":{"name":"releaseNotes","abstract":"

    The release notes JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html#/s:5Siren11LookupModelV7ResultsV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO7versionyA2HmF":{"name":"version","abstract":"

    The current App Store version JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/Results/CodingKeys.html":{"name":"CodingKeys","abstract":"

    Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV5appIDSivp":{"name":"appID","abstract":"

    The app’s App ID.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV25currentVersionReleaseDateSSvp":{"name":"currentVersionReleaseDate","abstract":"

    The release date for the latest verison of the app.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV16minimumOSVersionSSvp":{"name":"minimumOSVersion","abstract":"

    The minimum verison of iOS that the current verison of the app requires.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV12releaseNotesSSSgvp":{"name":"releaseNotes","abstract":"

    The releases notes from the latest version of the app.

    ","parent_name":"Results"},"Structs/LookupModel/Results.html#/s:5Siren11LookupModelV7ResultsV7versionSSvp":{"name":"version","abstract":"

    The latest version of the app.

    ","parent_name":"Results"},"Structs/LookupModel/CodingKeys.html#/s:5Siren11LookupModelV10CodingKeys33_F2A9942F3CA9D99FD9845937489F40B8LLO7resultsyA2FmF":{"name":"results","abstract":"

    The results JSON key.

    ","parent_name":"CodingKeys"},"Structs/LookupModel/CodingKeys.html":{"name":"CodingKeys","abstract":"

    Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.

    ","parent_name":"LookupModel"},"Structs/LookupModel.html#/s:5Siren11LookupModelV7resultsSayAC7ResultsVGvp":{"name":"results","abstract":"

    The array of results objects from the iTunes Lookup API.

    ","parent_name":"LookupModel"},"Structs/LookupModel/Results.html":{"name":"Results","abstract":"

    The Results object from the the iTunes Lookup API.

    ","parent_name":"LookupModel"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6arabicyA2EmF":{"name":"arabic","abstract":"

    Arabic Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8armenianyA2EmF":{"name":"armenian","abstract":"

    Armenian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6basqueyA2EmF":{"name":"basque","abstract":"

    Basque Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO17chineseSimplifiedyA2EmF":{"name":"chineseSimplified","abstract":"

    Simplified Chinese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18chineseTraditionalyA2EmF":{"name":"chineseTraditional","abstract":"

    Traditional Chinese Localization Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8croatianyA2EmF":{"name":"croatian","abstract":"

    Croatian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5czechyA2EmF":{"name":"czech","abstract":"

    Czech Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6danishyA2EmF":{"name":"danish","abstract":"

    Danish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5dutchyA2EmF":{"name":"dutch","abstract":"

    Dutch Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7englishyA2EmF":{"name":"english","abstract":"

    English Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8estonianyA2EmF":{"name":"estonian","abstract":"

    Estonian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7finnishyA2EmF":{"name":"finnish","abstract":"

    Finnish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6frenchyA2EmF":{"name":"french","abstract":"

    French Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6germanyA2EmF":{"name":"german","abstract":"

    German Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5greekyA2EmF":{"name":"greek","abstract":"

    Greek Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6hebrewyA2EmF":{"name":"hebrew","abstract":"

    Hebrew Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9hungarianyA2EmF":{"name":"hungarian","abstract":"

    Hungarian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10indonesianyA2EmF":{"name":"indonesian","abstract":"

    Indonesian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7italianyA2EmF":{"name":"italian","abstract":"

    Italian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO8japaneseyA2EmF":{"name":"japanese","abstract":"

    Japanese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6koreanyA2EmF":{"name":"korean","abstract":"

    Korean Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7latvianyA2EmF":{"name":"latvian","abstract":"

    Latvian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10lithuanianyA2EmF":{"name":"lithuanian","abstract":"

    Lithuanian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO5malayyA2EmF":{"name":"malay","abstract":"

    Malay Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9norwegianyA2EmF":{"name":"norwegian","abstract":"

    Norwegian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7persianyA2EmF":{"name":"persian","abstract":"

    Persian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18persianAfghanistanyA2EmF":{"name":"persianAfghanistan","abstract":"

    Persian (Afghanistan) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO11persianIranyA2EmF":{"name":"persianIran","abstract":"

    Persian (Iran) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO6polishyA2EmF":{"name":"polish","abstract":"

    Polish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO16portugueseBrazilyA2EmF":{"name":"portugueseBrazil","abstract":"

    Brazilian Portuguese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO18portuguesePortugalyA2EmF":{"name":"portuguesePortugal","abstract":"

    Portugal’s Portuguese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7russianyA2EmF":{"name":"russian","abstract":"

    Russian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO15serbianCyrillicyA2EmF":{"name":"serbianCyrillic","abstract":"

    Serbian (Cyrillic) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO12serbianLatinyA2EmF":{"name":"serbianLatin","abstract":"

    Serbian (Latin) Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9slovenianyA2EmF":{"name":"slovenian","abstract":"

    Slovenian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7spanishyA2EmF":{"name":"spanish","abstract":"

    Spanish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7swedishyA2EmF":{"name":"swedish","abstract":"

    Swedish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO4thaiyA2EmF":{"name":"thai","abstract":"

    Thai Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO7turkishyA2EmF":{"name":"turkish","abstract":"

    Turkish Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO4urduyA2EmF":{"name":"urdu","abstract":"

    Urdu Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO9ukrainianyA2EmF":{"name":"ukrainian","abstract":"

    Ukranian Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html#/s:5Siren12LocalizationV8LanguageO10vietnameseyA2EmF":{"name":"vietnamese","abstract":"

    Vietnamese Language Localization

    ","parent_name":"Language"},"Structs/Localization/Language.html":{"name":"Language","abstract":"

    Determines the available languages in which the update message and alert button titles should appear.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV7appName33_2FDBEF65899237DA36B11FA5846AD0EALLSSvp":{"name":"appName","abstract":"

    The name of the app as defined by the Info.plist.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV13forceLanguage33_2FDBEF65899237DA36B11FA5846AD0EALLAC0D0OSgvp":{"name":"forceLanguage","abstract":"

    Overrides the default localization of a user’s device when presenting the update message and button titles in the alert.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV7appName016andForceLanguageB0ACSSSg_AC0G0OSgtcfc":{"name":"init(appName:andForceLanguageLocalization:)","abstract":"

    Initializes

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV12alertMessage25forCurrentAppStoreVersionS2S_tF":{"name":"alertMessage(forCurrentAppStoreVersion:)","abstract":"

    The localized string for the UIAlertController‘s message field. .

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV10alertTitleSSyF":{"name":"alertTitle()","abstract":"

    The localized string for the UIAlertController‘s title field. .

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV19nextTimeButtonTitleSSyF":{"name":"nextTimeButtonTitle()","abstract":"

    The localized string for the Next time UIAlertAction.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV15skipButtonTitleSSyF":{"name":"skipButtonTitle()","abstract":"

    The localized string for the Skip this version UIAlertAction.

    ","parent_name":"Localization"},"Structs/Localization.html#/s:5Siren12LocalizationV17updateButtonTitleSSyF":{"name":"updateButtonTitle()","abstract":"

    The localized string for the Update UIAlertAction.

    ","parent_name":"Localization"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV12alertMessageSSvpZ":{"name":"alertMessage","abstract":"

    The text that conveys the message that there is an app update available

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV10alertTitleSSvpZ":{"name":"alertTitle","abstract":"

    The alert title which defaults to Update Available.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV19nextTimeButtonTitleSSvpZ":{"name":"nextTimeButtonTitle","abstract":"

    The button text that conveys the message that the user should be prompted to update next time the app launches.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV15skipButtonTitleSSvpZ":{"name":"skipButtonTitle","abstract":"

    The text that conveys the message that the the user wants to skip this verison update.

    ","parent_name":"AlertConstants"},"Structs/AlertConstants.html#/s:5Siren14AlertConstantsV17updateButtonTitleSSvpZ":{"name":"updateButtonTitle","abstract":"

    The button text that conveys the message that the user would like to update the app right away.

    ","parent_name":"AlertConstants"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5majoryA2EmF":{"name":"major","abstract":"

    Major release available: A.b.c.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5minoryA2EmF":{"name":"minor","abstract":"

    Minor release available: a.B.c.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO5patchyA2EmF":{"name":"patch","abstract":"

    Patch release available: a.b.C.d

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO8revisionyA2EmF":{"name":"revision","abstract":"

    Revision release available: a.b.c.D

    ","parent_name":"UpdateType"},"Structs/RulesManager/UpdateType.html#/s:5Siren12RulesManagerV10UpdateTypeO7unknownyA2EmF":{"name":"unknown","abstract":"

    No information available about the update.

    ","parent_name":"UpdateType"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV15releasedForDaysSivp":{"name":"releasedForDays","abstract":"

    The alert will only show up if the current version has already been released for X days.

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011majorUpdateB0AA0B0Vvp":{"name":"majorUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a major version update (A.b.c.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011minorUpdateB0AA0B0Vvp":{"name":"minorUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a minor version update (a.B.c.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011patchUpdateB0AA0B0Vvp":{"name":"patchUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a patch version update (a.b.C.d).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV014revisionUpdateB0AA0B0Vvp":{"name":"revisionUpdateRules","abstract":"

    The Rules that should be used when the App Store version of the app signifies that it is a revision version update (a.b.c.D).

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV011majorUpdateB005minoreB005patcheB008revisioneB050showAlertAfterCurrentVersionHasBeenReleasedForDaysAcA0B0V_A3JSitcfc":{"name":"init(majorUpdateRules:minorUpdateRules:patchUpdateRules:revisionUpdateRules:showAlertAfterCurrentVersionHasBeenReleasedForDays:)","abstract":"

    Initializer that sets update-specific Rules for all updates (e.g., major, minor, patch, revision).","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV06globalB050showAlertAfterCurrentVersionHasBeenReleasedForDaysAcA0B0V_Sitcfc":{"name":"init(globalRules:showAlertAfterCurrentVersionHasBeenReleasedForDays:)","abstract":"

    Initializer that sets the same update Rules for all types of updates (e.g., major, minor, patch, revision).","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV04loadB13ForUpdateTypeyAA0B0VAC0fG0OF":{"name":"loadRulesForUpdateType(_:)","abstract":"

    Returns the appropriate update rules based on the type of version that is returned from the API.

    ","parent_name":"RulesManager"},"Structs/RulesManager.html#/s:5Siren12RulesManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default RulesManager.

    ","parent_name":"RulesManager"},"Structs/RulesManager/UpdateType.html":{"name":"UpdateType","abstract":"

    Informs Siren of the type of update that is available so that","parent_name":"RulesManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17CompletionHandlera":{"name":"CompletionHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12localizationAA12LocalizationVvp":{"name":"localization","abstract":"

    The localization data structure that will be used to construct localized strings for the update alert.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV9tintColorSo7UIColorCSgvp":{"name":"tintColor","abstract":"

    The tint color of the UIAlertController buttons.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12alertMessageSSvp":{"name":"alertMessage","abstract":"

    The descriptive update message of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV10alertTitleSSvp":{"name":"alertTitle","abstract":"

    The main message of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV19nextTimeButtonTitleSSvp":{"name":"nextTimeButtonTitle","abstract":"

    The Next time button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15skipButtonTitleSSvp":{"name":"skipButtonTitle","abstract":"

    The Skip this version button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17updateButtonTitleSSvp":{"name":"updateButtonTitle","abstract":"

    The Update button text of the UIAlertController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15alertController33_CEF2109017F934DAB33AED8753BA096CLLSo07UIAlertE0CSgvp":{"name":"alertController","abstract":"

    The instance of the UIAlertController used to present the update alert.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV13updaterWindow33_CEF2109017F934DAB33AED8753BA096CLLSo8UIWindowCvp":{"name":"updaterWindow","abstract":"

    The UIWindow instance that presents the SirenViewController.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV14alertTintColor7appName0D5Title0D7Message012updateButtonI008nextTimelI004skiplI025forceLanguageLocalizationACSo7UIColorCSg_SSSgS5SAA0R0V0Q0OSgtcfc":{"name":"init(alertTintColor:appName:alertTitle:alertMessage:updateButtonTitle:nextTimeButtonTitle:skipButtonTitle:forceLanguageLocalization:)","abstract":"

    PresentationManager‘s public initializer.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default PresentationManager.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV12presentAlert9withRules25forCurrentAppStoreVersion10completionyAA0G0V_SSyAA0E6ActionOcSgtF":{"name":"presentAlert(withRules:forCurrentAppStoreVersion:completion:)","abstract":"

    Constructs the localized update alert UIAlertController object.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV17updateAlertAction33_CEF2109017F934DAB33AED8753BA096CLL10completionSo07UIAlertF0CyAA0eF0OcSg_tF":{"name":"updateAlertAction(completion:)","abstract":"

    The UIAlertAction that is executed when the Update option is selected.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV19nextTimeAlertAction33_CEF2109017F934DAB33AED8753BA096CLL10completionSo07UIAlertG0CyAA0fG0OcSg_tF":{"name":"nextTimeAlertAction(completion:)","abstract":"

    The UIAlertAction that is executed when the Next time option is selected.

    ","parent_name":"PresentationManager"},"Structs/PresentationManager.html#/s:5Siren19PresentationManagerV15skipAlertAction33_CEF2109017F934DAB33AED8753BA096CLL25forCurrentAppStoreVersion10completionSo07UIAlertF0CSS_yAA0eF0OcSgtF":{"name":"skipAlertAction(forCurrentAppStoreVersion:completion:)","abstract":"

    The UIAlertAction that is executed when the Skip this version option is selected.

    ","parent_name":"PresentationManager"},"Structs/APIManager/Constants.html#/s:5Siren10APIManagerV9Constants33_8071139324B24E2065F4037045A8D960LLV8bundleIDSSvpZ":{"name":"bundleID","abstract":"

    Constant for the bundleId parameter in the iTunes Lookup API request.

    ","parent_name":"Constants"},"Structs/APIManager/Constants.html#/s:5Siren10APIManagerV9Constants33_8071139324B24E2065F4037045A8D960LLV7countrySSvpZ":{"name":"country","abstract":"

    Constant for the country parameter in the iTunes Lookup API request.

    ","parent_name":"Constants"},"Structs/APIManager/Constants.html":{"name":"Constants","abstract":"

    Constants used in the APIManager.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV17CompletionHandlera":{"name":"CompletionHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV11countryCodeSSSgvp":{"name":"countryCode","abstract":"

    The region or country of an App Store in which the app is available.","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV11countryCodeACSSSg_tcfc":{"name":"init(countryCode:)","abstract":"

    Initializes APIManager to the region or country of an App Store in which the app is available.","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV7defaultACvpZ":{"name":"default","abstract":"

    The default APIManager.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV26performVersionCheckRequest10completionyyAA11LookupModelVSg_AA10KnownErrorOSgtcSg_tF":{"name":"performVersionCheckRequest(completion:)","abstract":"

    Creates and performs a URLRequest against the iTunes Lookup API.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV26processVersionCheckResults33_8071139324B24E2065F4037045A8D960LL8withData8response5error10completiony10Foundation0M0VSg_So13NSURLResponseCSgs5Error_pSgyAA11LookupModelVSg_AA05KnownS0OSgtcSgtF":{"name":"processVersionCheckResults(withData:response:error:completion:)","abstract":"

    Parses and maps the the results from the iTunes Lookup API request.

    ","parent_name":"APIManager"},"Structs/APIManager.html#/s:5Siren10APIManagerV13makeITunesURL33_8071139324B24E2065F4037045A8D960LL10Foundation0E0VyKF":{"name":"makeITunesURL()","abstract":"

    Creates the URL that points to the iTunes Lookup API.

    ","parent_name":"APIManager"},"Structs/APIManager.html":{"name":"APIManager","abstract":"

    APIManager for Siren

    "},"Structs/PresentationManager.html":{"name":"PresentationManager","abstract":"

    PresentationManager for Siren

    "},"Structs/RulesManager.html":{"name":"RulesManager","abstract":"

    RulesManager for Siren

    "},"Structs/AlertConstants.html":{"name":"AlertConstants","abstract":"

    The default constants used for the update alert’s messaging.

    "},"Structs/Localization.html":{"name":"Localization","abstract":"

    Localization information and strings for Siren.

    "},"Structs/LookupModel.html":{"name":"LookupModel","abstract":"

    Model representing a selection of results from the iTunes Lookup API.

    "},"Structs/Results.html":{"name":"Results","abstract":"

    The relevant metadata returned from Siren upon completing a successful version check.

    "},"Structs/Rules.html":{"name":"Rules","abstract":"

    Alert Presentation Rules for Siren.

    "},"Structs/DataParser.html":{"name":"DataParser","abstract":"

    Version parsing functions for Siren.

    "},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO37PerformVersionCheckOnSubsequentLaunchyA2FmF":{"name":"PerformVersionCheckOnSubsequentLaunch","abstract":"

    Key that notifies Siren to perform a version check and present","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO22StoredVersionCheckDateyA2FmF":{"name":"StoredVersionCheckDate","abstract":"

    Key that stores the timestamp of the last version check.

    ","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html#/s:So14NSUserDefaultsC5SirenE0C4Keys33_0884631E60E090AA276701A736B793BBLLO20StoredSkippedVersionyA2FmF":{"name":"StoredSkippedVersion","abstract":"

    Key that stores the version that a user decided to skip.

    ","parent_name":"SirenKeys"},"Extensions/UserDefaults/SirenKeys.html":{"name":"SirenKeys","abstract":"

    Siren-specific UserDefaults Keys

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE43shouldPerformVersionCheckOnSubsequentLaunchSbvpZ":{"name":"shouldPerformVersionCheckOnSubsequentLaunch","abstract":"

    Sets and Gets a UserDefault around performing a version check on a subsequent launch.

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE20storedSkippedVersionSSSgvpZ":{"name":"storedSkippedVersion","abstract":"

    Sets and Gets a UserDefault around storing a version that the user wants to skip updating.

    ","parent_name":"UserDefaults"},"Extensions/UserDefaults.html#/s:So14NSUserDefaultsC5SirenE21alertPresentationDate10Foundation0F0VSgvpZ":{"name":"alertPresentationDate","abstract":"

    Sets and Gets a UserDefault around the last time the user was presented a version update alert.

    ","parent_name":"UserDefaults"},"Extensions/UIAlertController.html#/s:So17UIAlertControllerC5SirenE4show6windowySo8UIWindowC_tF":{"name":"show(window:)","abstract":"

    Presents Siren’s UIAlertController in a new UIWindow.

    ","parent_name":"UIAlertController"},"Extensions/UIAlertController.html#/s:So17UIAlertControllerC5SirenE4hide6windowySo8UIWindowC_tF":{"name":"hide(window:)","abstract":"

    Hides Siren’s UIAlertController within a given window.

    ","parent_name":"UIAlertController"},"Extensions/Date.html#/s:10Foundation4DateV5SirenE4days5sinceSiAC_tFZ":{"name":"days(since:)","abstract":"

    The amount of days passed from a specific source date.

    ","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV5SirenE4days5sinceSiSgSS_tFZ":{"name":"days(since:)","abstract":"

    The amount of days passed from a specific source date string.

    ","parent_name":"Date"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV15bundleExtensionSSvpZ":{"name":"bundleExtension","abstract":"

    Constant for the .bundle file extension.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV11displayNameSSvpZ":{"name":"displayName","abstract":"

    Constant for CFBundleDisplayName.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV19englishLocalizationSSvpZ":{"name":"englishLocalization","abstract":"

    Constant for the default US English localization.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV16projectExtensionSSvpZ":{"name":"projectExtension","abstract":"

    Constant for the project file extension.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV18shortVersionStringSSvpZ":{"name":"shortVersionString","abstract":"

    Constant for CFBundleShortVersionString.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html#/s:So8NSBundleC5SirenE9ConstantsV5tableSSvpZ":{"name":"table","abstract":"

    Constant for the localization table.

    ","parent_name":"Constants"},"Extensions/Bundle/Constants.html":{"name":"Constants","abstract":"

    Constants used in the Bundle extension.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE7versionSSSgyFZ":{"name":"version()","abstract":"

    Fetches the current verison of the app.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE15localizedString6forKey20andForceLocalizationS2S_AC0I0V8LanguageOSgtFZ":{"name":"localizedString(forKey:andForceLocalization:)","abstract":"

    Returns the localized string for a given default string.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE19bestMatchingAppNameSSyFZ":{"name":"bestMatchingAppName()","abstract":"

    The appropriate name for the app to be displayed in the update alert.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE15sirenBundlePath33_9C775CF4CEC7A5F21E625F58C71BDF22LLSSSgyFZ":{"name":"sirenBundlePath()","abstract":"

    The path to Siren’s localization Bundle.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE21sirenForcedBundlePath33_9C775CF4CEC7A5F21E625F58C71BDF22LL25forceLanguageLocalizationSSSgAC0R0V0Q0O_tFZ":{"name":"sirenForcedBundlePath(forceLanguageLocalization:)","abstract":"

    The path for a particular language localizationin Siren’s localization Bundle.

    ","parent_name":"Bundle"},"Extensions/Bundle.html#/s:So8NSBundleC5SirenE14deviceLanguage33_9C775CF4CEC7A5F21E625F58C71BDF22LLAC12LocalizationV0D0OSgyFZ":{"name":"deviceLanguage()","abstract":"

    The user’s preferred language based on their device’s localization.

    ","parent_name":"Bundle"},"Extensions/Bundle.html":{"name":"Bundle"},"Extensions/Date.html":{"name":"Date"},"Extensions/UIAlertController.html":{"name":"UIAlertController"},"Extensions/UserDefaults.html":{"name":"UserDefaults"},"Enums/KnownError.html#/s:5Siren10KnownErrorO20appStoreAppIDFailureyA2CmF":{"name":"appStoreAppIDFailure","abstract":"

    Error retrieving trackId as the JSON does not contain a ‘trackId’ key.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO33appStoreDataRetrievalEmptyResultsyA2CmF":{"name":"appStoreDataRetrievalEmptyResults","abstract":"

    Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the countryCode variable to fix this error.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO28appStoreDataRetrievalFailureyACs0C0_pSg_tcACmF":{"name":"appStoreDataRetrievalFailure(underlyingError:)","abstract":"

    Error retrieving App Store data as an error was returned.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO26appStoreJSONParsingFailureyACs0C0_p_tcACmF":{"name":"appStoreJSONParsingFailure(underlyingError:)","abstract":"

    Error parsing App Store JSON data.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO28appStoreOSVersionUnsupportedyA2CmF":{"name":"appStoreOSVersionUnsupported","abstract":"

    The version of iOS on the device is lower than that of the one required by the app verison update.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO27appStoreVersionArrayFailureyA2CmF":{"name":"appStoreVersionArrayFailure","abstract":"

    Error retrieving App Store verson number as the JSON does not contain a version key.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO25currentVersionReleaseDateyA2CmF":{"name":"currentVersionReleaseDate","abstract":"

    The currentVersionReleaseDate key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO12malformedURLyA2CmF":{"name":"malformedURL","abstract":"

    One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO15missingBundleIDyA2CmF":{"name":"missingBundleID","abstract":"

    Please make sure that you have set a Bundle Identifier in your project.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO17noUpdateAvailableyA2CmF":{"name":"noUpdateAvailable","abstract":"

    No new update available.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO16recentlyPromptedyA2CmF":{"name":"recentlyPrompted","abstract":"

    Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the UpdatePromptFrequency.immediately rule in RulesManager

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO15releasedTooSoonyACSi_SitcACmF":{"name":"releasedTooSoon(daysSinceRelease:releasedForDays:)","abstract":"

    The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO17skipVersionUpdateyACSS_SStcACmF":{"name":"skipVersionUpdate(installedVersion:appStoreVersion:)","abstract":"

    The user has opted to skip updating their current version of the app to the current App Store version.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"

    The localized description for each error handled by Siren.

    ","parent_name":"KnownError"},"Enums/KnownError.html#/s:5Siren10KnownErrorO05sirenC033_B3C911EAD28C83CC211C07566B0F499ALLSSvpZ":{"name":"sirenError","abstract":"

    An easily identifiable prefix for all errors thrown by Siren.

    ","parent_name":"KnownError"},"Enums/AlertAction.html#/s:5Siren11AlertActionO8appStoreyA2CmF":{"name":"appStore","abstract":"

    The user clicked on the Update option, which took them to the app’s App Store page.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO8nextTimeyA2CmF":{"name":"nextTime","abstract":"

    The user clicked on the Next Time option, which dismissed the alert.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO4skipyA2CmF":{"name":"skip","abstract":"

    The user clicked on the Skip this version option, which dismissed the alert.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html#/s:5Siren11AlertActionO7unknownyA2CmF":{"name":"unknown","abstract":"

    (Default) The user never chose an option. This is returned when an error is thrown by Siren.

    ","parent_name":"AlertAction"},"Enums/AlertAction.html":{"name":"AlertAction","abstract":"

    The UIAlertController button that was pressed upon being presented an update alert.

    "},"Enums/KnownError.html":{"name":"KnownError","abstract":"

    Enumerates all potentials errors that Siren can handle.

    "},"Classes/SirenViewController.html#/c:@M@Siren@objc(cs)SirenViewController(py)preferredStatusBarStyle":{"name":"preferredStatusBarStyle","abstract":"

    UIStatusBarStyle override.

    ","parent_name":"SirenViewController"},"Classes/Siren.html#/s:5SirenAAC14ResultsHandlera":{"name":"ResultsHandler","abstract":"

    Return results or errors obtained from performing a version check with Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC6sharedABvpZ":{"name":"shared","abstract":"

    The Siren singleton. The main point of entry to the Siren library.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12debugEnabledSbvp":{"name":"debugEnabled","abstract":"

    The debug flag, which is disabled by default.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC10apiManagerAA10APIManagerVvp":{"name":"apiManager","abstract":"

    The manager that controls the App Store API that is","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC19presentationManagerAA012PresentationC0Vvp":{"name":"presentationManager","abstract":"

    The manager that controls the update alert’s string localization and tint color.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12rulesManagerAA05RulesC0Vvp":{"name":"rulesManager","abstract":"

    The manager that controls the type of alert that should be displayed","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23currentInstalledVersionSSSgvp":{"name":"currentInstalledVersion","abstract":"

    The current installed version of your app.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC23didBecomeActiveObserverSo8NSObject_pSgvp":{"name":"didBecomeActiveObserver","abstract":"

    The retained NotificationCenter observer that listens for UIApplication.didBecomeActiveNotification notifications.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC21alertPresentationDate33_7DFB1BC200A6C64FBED860A3A8153B65LL10Foundation0D0VSgvp":{"name":"alertPresentationDate","abstract":"

    The last date that an alert was presented to the user.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC5appID33_7DFB1BC200A6C64FBED860A3A8153B65LLSiSgvp":{"name":"appID","abstract":"

    The App Store’s unique identifier for an app.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14resultsHandler33_7DFB1BC200A6C64FBED860A3A8153B65LLyAA7ResultsVSg_AA10KnownErrorOSgtcSgvp":{"name":"resultsHandler","abstract":"

    The completion handler used to return the results or errors returned by Siren.

    ","parent_name":"Siren"},"Classes/Siren.html#/c:@M@Siren@objc(cs)Siren(im)init":{"name":"init()","abstract":"

    The initialization method.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC4wail10completionyyAA7ResultsVSg_AA10KnownErrorOSgtcSg_tF":{"name":"wail(completion:)","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC14launchAppStoreyyF":{"name":"launchAppStore()","abstract":"

    Launches the AppStore in two situations when the user clicked the Update button in the UIAlertController modal.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC19performVersionCheckyyF":{"name":"performVersionCheck()","abstract":"

    Initiates the uni-directional version checking flow.

    ","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC8validate5modelyAA11LookupModelV_tF":{"name":"validate(model:)","abstract":"

    Validates the parsed and mapped iTunes Lookup Model","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC45determineIfAlertPresentationRulesAreSatisfied25forCurrentAppStoreVersion14andLookupModelySS_AA0oP0VtF":{"name":"determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion:andLookupModel:)","abstract":"

    Determines if the update alert can be presented based on the","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12presentAlert9withRules25forCurrentAppStoreVersion5model13andUpdateTypeyAA0E0V_SSAA11LookupModelVAA0E7ManagerV0mN0OtF":{"name":"presentAlert(withRules:forCurrentAppStoreVersion:model:andUpdateType:)","abstract":"

    Presents the update alert to the end user.","parent_name":"Siren"},"Classes/Siren.html#/s:5SirenAAC12addObserversyyF":{"name":"addObservers()","abstract":"

    Add an observer that listens for app launching/relaunching","parent_name":"Siren"},"Classes/Siren.html":{"name":"Siren","abstract":"

    The Siren Class.

    "},"Classes/SirenViewController.html":{"name":"SirenViewController","abstract":"

    UIViewController Extension for Siren

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "}} \ No newline at end of file