Compare commits
400 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6101b30b3e | |||
| 208f0ade0a | |||
| e285ded587 | |||
| f2dc07757c | |||
| 6d7613fa3e | |||
| 2352276947 | |||
| 28b789f28f | |||
| d14e0ad046 | |||
| d322afa41a | |||
| a5a95c43af | |||
| a6a521c8d1 | |||
| 18a56fa45e | |||
| 278d9e863e | |||
| ba2bc03263 | |||
| 28aba0f794 | |||
| e8ac4b78e1 | |||
| daaa063c60 | |||
| f339fab54d | |||
| 69d49689ce | |||
| bd4b17fafc | |||
| 950830d94d | |||
| 11bfdca77a | |||
| 3e1aa263cb | |||
| 628ff9bb8d | |||
| 4dd92112eb | |||
| 7c5f153e1f | |||
| 3717686bf8 | |||
| 404e61bcf2 | |||
| 4d4fb66fd1 | |||
| 43232c3e94 | |||
| 04ecdc5d86 | |||
| c14ffbeaca | |||
| c6dd2e38d9 | |||
| f37197e2d6 | |||
| 1301d13b19 | |||
| 868fd61abb | |||
| fd3160ead2 | |||
| bbf166c41e | |||
| fa410383fb | |||
| 28f7595712 | |||
| d49d41a147 | |||
| 4a329bafff | |||
| 4569b1352c | |||
| 2632a9b661 | |||
| 74f266aaf0 | |||
| 7a66d39eaa | |||
| 5ee91398b4 | |||
| 2238ed76d9 | |||
| 77fec7c466 | |||
| 95b35eb045 | |||
| cf99475842 | |||
| dee148be33 | |||
| cb3e865e96 | |||
| ef8f6e1a8e | |||
| 98dd98b8b5 | |||
| 3d5775a00f | |||
| 5f0c8419c8 | |||
| 474c84222b | |||
| 1a868a150e | |||
| 2d29f1cc2c | |||
| 9d98c4679c | |||
| 3a47bd871b | |||
| 03eb15e777 | |||
| 0d0f4887cb | |||
| 3ba76fdc47 | |||
| 01673fd537 | |||
| 75dc8c6f6c | |||
| 1703c5ae79 | |||
| d756bc3a24 | |||
| 069cec7f32 | |||
| 8c37767148 | |||
| 2fe102ff74 | |||
| 5b62f92e4e | |||
| eadb751685 | |||
| f56152a9df | |||
| 7d406f036a | |||
| eeb82ba4fd | |||
| 584a80b632 | |||
| 0d7c714a8a | |||
| a9ba10ca92 | |||
| a419497417 | |||
| 3da6a98846 | |||
| 09c7b75422 | |||
| e990e9f2fe | |||
| 9e6e048c04 | |||
| ad34efecf5 | |||
| b644a64c92 | |||
| f0d3c95016 | |||
| 9db883b865 | |||
| 7c007c5bf5 | |||
| b9d9d28f6d | |||
| 97fe30182e | |||
| 5e85d1e249 | |||
| 87b6eb6de3 | |||
| e0c235bb83 | |||
| 867e6eae80 | |||
| d2958034a1 | |||
| 3186be638a | |||
| 2325a8e000 | |||
| 3dc1167ef0 | |||
| 6469d9bcc8 | |||
| 2e37cf3a92 | |||
| 81b6215f38 | |||
| 37721a16f8 | |||
| 723fb87314 | |||
| 235ea58060 | |||
| 25e017d493 | |||
| 65fb91be84 | |||
| e358e9aaaf | |||
| 5571d2a830 | |||
| af0129a575 | |||
| cd9d2cfb7d | |||
| dabfc6954c | |||
| f6d8c8236e | |||
| c7fdeea006 | |||
| d907d7b844 | |||
| 239470dd56 | |||
| f6ca8b35fc | |||
| 793937d267 | |||
| e097b70bb7 | |||
| 320180c9db | |||
| bb2d47f291 | |||
| 3fdb59cbc5 | |||
| f62f1a4ad6 | |||
| 6ab95d8790 | |||
| d7185713ee | |||
| a983f87db4 | |||
| bd7848a58e | |||
| b8fbf0ad60 | |||
| 6470aa1da6 | |||
| ddecd65839 | |||
| ee0baccf5d | |||
| 4cb63928fc | |||
| 01ebed423b | |||
| 4f71a25af6 | |||
| 0b1108a1bb | |||
| 5378f2e209 | |||
| 432a22fc68 | |||
| aa08139881 | |||
| e5a8883796 | |||
| 0e883c9f14 | |||
| 70da5ecc98 | |||
| 3cca924560 | |||
| 60192ae78d | |||
| 393a358d94 | |||
| 846d1299ec | |||
| ee195d6ab8 | |||
| acaffbf79d | |||
| 4f4105d513 | |||
| bf44aeca22 | |||
| 203df46727 | |||
| cf4d08df05 | |||
| 2e3d270a38 | |||
| f416bda41f | |||
| e88ecc221c | |||
| 2507debd48 | |||
| 58d090ba0e | |||
| 2af44e800f | |||
| 4265aba2fe | |||
| f53419b27c | |||
| 83ba5134c0 | |||
| abec09af89 | |||
| 2ad65fe691 | |||
| 2e3e7378cd | |||
| 31ce3c9bc8 | |||
| 8cf155bc59 | |||
| 4e2a3ecd58 | |||
| 49765dede0 | |||
| 2b46894f23 | |||
| fb89ce52f5 | |||
| 926fcd145c | |||
| 3c67373e21 | |||
| 81e616a755 | |||
| 644626a8de | |||
| 0c238dba3a | |||
| 2e082ce650 | |||
| ca00ff5ddc | |||
| 5b42356910 | |||
| 8bf7b6ae83 | |||
| 26d846901e | |||
| 8cd1d240c8 | |||
| 0677e9cf4c | |||
| 24b7277faa | |||
| adb565191d | |||
| 5463024d52 | |||
| 78f4d02e78 | |||
| 4c0897ee2c | |||
| d5be94fdf5 | |||
| 51f74c44e7 | |||
| 22f0a74423 | |||
| b2f9faec5c | |||
| 1346e98ab7 | |||
| 02c5a5fe1c | |||
| 6090905c63 | |||
| 9b51c18f43 | |||
| e6d5cc7706 | |||
| 3818fcb98e | |||
| 9cdb23396c | |||
| 788fbe94d9 | |||
| 5738982403 | |||
| e99ae0dafc | |||
| 07cc394df3 | |||
| 61beab4398 | |||
| 10ca21b91c | |||
| f002994fc0 | |||
| 2f77b8ec88 | |||
| 6fd1ee5397 | |||
| 036022115d | |||
| 3ad716169f | |||
| e0dda27c4e | |||
| b38582dfcd | |||
| 598cf27728 | |||
| 91bb2d51a7 | |||
| b3ee4623ba | |||
| 2f32e615d8 | |||
| 5ef0af2a99 | |||
| a4dffddc25 | |||
| 25c365641f | |||
| 4250d4144d | |||
| 9f11ec3006 | |||
| ae9c8b7881 | |||
| 180952e41e | |||
| 610f3aa0fd | |||
| c313976fe5 | |||
| 6a9210ea98 | |||
| 55e2391ea8 | |||
| 5043485759 | |||
| 2c796d19de | |||
| 001dbf7f7b | |||
| 0c16712707 | |||
| 5a96d0e14b | |||
| 9c3466180b | |||
| 52e4503132 | |||
| 32311a2eb8 | |||
| 46886de89b | |||
| d801159fd4 | |||
| 67e4aef8c7 | |||
| eb401381ef | |||
| ae848c8d53 | |||
| 866fadeacd | |||
| 1c85fdd9d2 | |||
| 82d3da4f69 | |||
| 8ccc0219a3 | |||
| 297936bad4 | |||
| fe29855443 | |||
| 8b29e64fca | |||
| 68256dcceb | |||
| 5a50ae097f | |||
| e2bb7dbc2c | |||
| 995f6a524f | |||
| 03d2544526 | |||
| bd0c4573ad | |||
| a2de47bd9f | |||
| 98c49d9a35 | |||
| 732c8f2867 | |||
| 9ee26f0efc | |||
| 157a8e8f44 | |||
| 1d1144e175 | |||
| ba1fa107fd | |||
| 091803dd5e | |||
| c64a30e0bf | |||
| 675bf7bc8b | |||
| 328e2ecbc7 | |||
| caba1fdae1 | |||
| d6f3930c47 | |||
| 29a30f69f5 | |||
| 07139b9b4a | |||
| c0e40271d3 | |||
| c81daf17b5 | |||
| eb6a0d56b9 | |||
| 6ffc0ac68a | |||
| 3f7c50f445 | |||
| 3a21914790 | |||
| 78dd7eaff7 | |||
| 3ec8d95f7d | |||
| f339141104 | |||
| f735dfb75b | |||
| a909585926 | |||
| 2a5d6830fe | |||
| 9260bcb93f | |||
| 4eea6ce5a3 | |||
| 442da19ef1 | |||
| b70ce2979b | |||
| a3248f2f9e | |||
| 6bb2aa9d97 | |||
| 1a8dc2fb19 | |||
| 55edc3f5dd | |||
| 8f5bd92e23 | |||
| cfd099d7b9 | |||
| 1ade5d1604 | |||
| fdc70034b3 | |||
| 9444c0ce49 | |||
| fc00c54589 | |||
| 79062d02b5 | |||
| 855a6d072f | |||
| 5bb360a85b | |||
| db4f19f4b8 | |||
| cdb2f7e6fc | |||
| d0cfa3de7d | |||
| aef76136a7 | |||
| fedf818b5f | |||
| 375d19ac27 | |||
| 720513cac1 | |||
| 6c99998b2f | |||
| c5b8045b82 | |||
| bce311ff80 | |||
| 9d6cf1271a | |||
| 1b8866f4b3 | |||
| 97203166d1 | |||
| 500bf49916 | |||
| 221e34e913 | |||
| 901b0761c7 | |||
| dec674e8ab | |||
| 3fab9e56b3 | |||
| 421c27ccc1 | |||
| 659eff76e0 | |||
| 88fea94452 | |||
| 17d655bb20 | |||
| 3a2781a0a8 | |||
| 2ad0c1c328 | |||
| ae172183f0 | |||
| d81e8357dd | |||
| b6cd1f6027 | |||
| fb2e915bb3 | |||
| 9e0acfc60e | |||
| 4b251ceaf4 | |||
| d1a9895497 | |||
| 0aa3ce95ea | |||
| eb53545256 | |||
| a9f205e779 | |||
| 0c1760410a | |||
| e59fac5a59 | |||
| 47ed9da2d6 | |||
| 1555ed2e00 | |||
| e43a87f284 | |||
| 335380ea24 | |||
| 598d9f0cb1 | |||
| 32cf1fb680 | |||
| 221056e96b | |||
| 3ae4866ea3 | |||
| 2cde4acedb | |||
| 07f75997ab | |||
| bb59bf12f2 | |||
| 71c7dd51dc | |||
| 1c6f55d869 | |||
| 6f0fbc6b45 | |||
| 687f312615 | |||
| e619a8c92b | |||
| c91b7fec9f | |||
| 42b2f5c076 | |||
| 80d2a999e0 | |||
| 8842953bd2 | |||
| 4f79d6c945 | |||
| 58f06eed5d | |||
| 82e039db84 | |||
| 073afff8cb | |||
| 46e982f699 | |||
| 0a3ba7690e | |||
| 98af0b6777 | |||
| 4f561ebf49 | |||
| da65515aca | |||
| cdd8c06b11 | |||
| d108153121 | |||
| 4ff4ed12b2 | |||
| 4cbac5258e | |||
| 09e8d99999 | |||
| 573ed1ec4d | |||
| 9d46770715 | |||
| 259573e9f0 | |||
| e71411ea09 | |||
| 8c659fad60 | |||
| 8883c65d82 | |||
| 4df5fec911 | |||
| 8fc676be89 | |||
| 033beba9ea | |||
| d0f1afe4a7 | |||
| bf8130bf1e | |||
| 36ca1fcc80 | |||
| eb92d2173b | |||
| 4622c17257 | |||
| d1247acc99 | |||
| ba3044c709 | |||
| 4bff506491 | |||
| 17279f1da2 | |||
| da67615804 | |||
| 6a94c4f4e5 | |||
| 2afe920c86 | |||
| 7f8c2a6fb1 | |||
| 1463428c8c | |||
| 8021367f54 | |||
| af139d649c | |||
| 8ba1ac7fb3 | |||
| 133bfd4088 | |||
| 0f0c7bbbd2 | |||
| b5a9cd6fd1 | |||
| bb8916f598 | |||
| de7f6654e2 | |||
| 6c5b0e3318 | |||
| 37cb67d979 | |||
| 0194a691c9 |
@@ -0,0 +1,18 @@
|
||||
Before posting an issue, please make sure your issue has not already been resolved or answered elsewhere.
|
||||
|
||||
Common Issue #1:
|
||||
> "Error retrieving iOS version number as there was no data returned."
|
||||
|
||||
Check if your app is available in the US App Store, otherwise add the corresponding country code when setting up Siren.
|
||||
|
||||
Common Issue #2:
|
||||
> "Support for macOS App Store."
|
||||
|
||||
Siren does not and will not support the macOS App Store.
|
||||
|
||||
Common Issue #3:
|
||||
> "Support for prompting TestFlight users to update to the newest beta build."
|
||||
|
||||
Siren does not support this functionality. There is no publicly accessible TestFlight API akin to that of the public App Store API that Siren can utilize to provide this functionality.
|
||||
|
||||
Please delete this text before submitting a new issue.
|
||||
@@ -16,6 +16,7 @@ DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
.DS_Store
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
module: Siren
|
||||
author: Arthur Ariel Sabintsev
|
||||
author_url: http://www.sabintsev.com
|
||||
github_url: https://github.com/artsabintsev/siren
|
||||
copyright: "© 2015-2017 [Arthur Ariel Sabintsev](http://www.sabintsev.com)"
|
||||
clean: true
|
||||
podspec: Siren.podspec
|
||||
@@ -0,0 +1 @@
|
||||
3.0
|
||||
@@ -0,0 +1,16 @@
|
||||
reporter: "xcode"
|
||||
|
||||
included:
|
||||
- ../Sources/
|
||||
|
||||
disabled_rules:
|
||||
- cyclomatic_complexity
|
||||
- unused_optional_binding
|
||||
- variable_name
|
||||
|
||||
# Specialized Rules
|
||||
file_length:
|
||||
- 1000
|
||||
|
||||
line_length:
|
||||
- 200
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 156 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 158 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 169 KiB |
Regular → Executable
+42
-4
@@ -1,11 +1,49 @@
|
||||
### Created and maintained by
|
||||
### Creators
|
||||
[Arthur Ariel Sabintsev](http://www.sabintsev.com/) and [Aaron Brager](http://twitter.com/GetAaron)
|
||||
|
||||
### Swift Project Contributors
|
||||
Open up a Pull Request to get your name on here.
|
||||
### 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](http://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)
|
||||
- [Christoph Mantler](https://github.com/ChrisixFlash) for [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/107)
|
||||
- [Txai Wieser](https://github.com/txaiwieser) for [Pull Request #140](https://github.com/ArtSabintsev/Siren/pull/107)
|
||||
- [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)
|
||||
|
||||
### Harpy Project Contributors
|
||||
This repo is a Swift language port of [Harpy](http://github.com/ArtSabintsev/Harpy). We couldn't have built this port without acknowledging the following developers who were instrumental in getting Harpy to its current state, v3.2.1 at the time this document was written.
|
||||
This repo is a Swift language port of [Harpy](http://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:
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# A sample Gemfile
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "cocoapods"
|
||||
gem "jazzy"
|
||||
@@ -0,0 +1,91 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (2.3.5)
|
||||
activesupport (4.2.8)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
claide (1.0.1)
|
||||
cocoapods (1.2.1)
|
||||
activesupport (>= 4.0.2, < 5)
|
||||
claide (>= 1.0.1, < 2.0)
|
||||
cocoapods-core (= 1.2.1)
|
||||
cocoapods-deintegrate (>= 1.0.1, < 2.0)
|
||||
cocoapods-downloader (>= 1.1.3, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
cocoapods-search (>= 1.0.0, < 2.0)
|
||||
cocoapods-stats (>= 1.0.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.2.0, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
fourflusher (~> 2.0.1)
|
||||
gh_inspector (~> 1.0)
|
||||
molinillo (~> 0.5.7)
|
||||
nap (~> 1.0)
|
||||
ruby-macho (~> 1.1)
|
||||
xcodeproj (>= 1.4.4, < 2.0)
|
||||
cocoapods-core (1.2.1)
|
||||
activesupport (>= 4.0.2, < 5)
|
||||
fuzzy_match (~> 2.0.4)
|
||||
nap (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.1)
|
||||
cocoapods-downloader (1.1.3)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.0)
|
||||
cocoapods-stats (1.0.0)
|
||||
cocoapods-trunk (1.2.0)
|
||||
nap (>= 0.8, < 2.0)
|
||||
netrc (= 0.7.8)
|
||||
cocoapods-try (1.1.0)
|
||||
colored2 (3.1.2)
|
||||
escape (0.0.4)
|
||||
fourflusher (2.0.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.0.3)
|
||||
i18n (0.8.4)
|
||||
jazzy (0.8.2)
|
||||
cocoapods (~> 1.0)
|
||||
mustache (~> 0.99)
|
||||
open4
|
||||
redcarpet (~> 3.2)
|
||||
rouge (~> 1.5)
|
||||
sass (~> 3.4)
|
||||
sqlite3 (~> 1.3)
|
||||
xcinvoke (~> 0.3.0)
|
||||
liferaft (0.0.6)
|
||||
minitest (5.10.2)
|
||||
molinillo (0.5.7)
|
||||
mustache (0.99.8)
|
||||
nanaimo (0.2.3)
|
||||
nap (1.1.0)
|
||||
netrc (0.7.8)
|
||||
open4 (1.3.4)
|
||||
redcarpet (3.4.0)
|
||||
rouge (1.11.1)
|
||||
ruby-macho (1.1.0)
|
||||
sass (3.4.24)
|
||||
sqlite3 (1.3.13)
|
||||
thread_safe (0.3.6)
|
||||
tzinfo (1.2.3)
|
||||
thread_safe (~> 0.1)
|
||||
xcinvoke (0.3.0)
|
||||
liferaft (~> 0.0.6)
|
||||
xcodeproj (1.4.4)
|
||||
CFPropertyList (~> 2.3.3)
|
||||
claide (>= 1.0.1, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.2.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods
|
||||
jazzy
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.6
|
||||
@@ -0,0 +1,5 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Siren"
|
||||
)
|
||||
@@ -1,189 +1,264 @@
|
||||
# Siren
|
||||
# Siren 🚨
|
||||
|
||||
### Notify users when a new version of your app is available, and prompt them with the App Store link.
|
||||
### Notify users when a new version of your app is available and prompt them to upgrade.
|
||||
|
||||
[](https://dashboard.buddybuild.com/apps/58c4d0d85601d40100c5c51d/build/latest?branch=master) [](https://cocoapods.org/pods/Siren) [](https://github.com/Carthage/Carthage) [](https://swift.org/package-manager/) [](https://cocoapods.org/pods/Siren) [](https://cocoapods.org/pods/Siren)
|
||||
---
|
||||
### About
|
||||
|
||||
## Table of Contents
|
||||
- [About](https://github.com/ArtSabintsev/Siren#about)
|
||||
- [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)
|
||||
- [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)
|
||||
- [App Store Review & Submissions](https://github.com/ArtSabintsev/Siren#app-store-submissions)
|
||||
- [Words of Caution](https://github.com/ArtSabintsev/Siren#words-of-caution)
|
||||
- [Ports](https://github.com/ArtSabintsev/Siren#ports)
|
||||
- [Attribution](https://github.com/ArtSabintsev/Siren#created-and-maintained-by)
|
||||
---
|
||||
|
||||
## About
|
||||
**Siren** checks a user's currently installed version of your iOS app against the version that is currently available in the App Store.
|
||||
|
||||
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**](http://semver.org/) system.
|
||||
- Siren is a Swift language port of [**Harpy**](http://github.com/ArtSabintsev/Harpy), an Objective-C library that achieves the same functionality.
|
||||
- Siren is actively maintained by [**Arthur Sabintsev**](http://github.com/ArtSabintsev) and [**Aaron Brager**](http://twitter.com/getaaron).
|
||||
- Semantic Versioning is 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**](http://github.com/ArtSabintsev) and [**Aaron Brager**](http://twitter.com/getaaron)
|
||||
|
||||
### Changelog
|
||||
#### 0.2.2
|
||||
- Fixed [Issue #6](https://github.com/ArtSabintsev/Siren/issues/6): Setting `checkType` to `.Daily` or `.Weekly` now works properly.
|
||||
- Other minor internal changes.
|
||||
### README Translations
|
||||
- [**简体中文**](README.zh_CN.md) (by [**Daniel Hu**](http://www.jianshu.com/u/d8bbc4831623))
|
||||
|
||||
### Features
|
||||
## Features
|
||||
- [x] CocoaPods Support
|
||||
- [x] Support for `UIAlertController` (iOS 8+) and `UIAlertView` (iOS 7)
|
||||
- [x] Localized for 18 languages (See **Localization** Section)
|
||||
- [x] Three types of alerts (see **Screenshots & Alert Types**)
|
||||
- [x] Optional delegate methods (see **Optional Delegate** section)
|
||||
- [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.
|
||||
|
||||
### Installation Instructions
|
||||
## 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.
|
||||
|
||||
#### CocoaPods Installation
|
||||
<img src="https://github.com/ArtSabintsev/Siren/blob/master/Assets/picForcedUpdate.png?raw=true" height="480"><img src="https://github.com/ArtSabintsev/Siren/blob/master/Assets/picOptionalUpdate.png?raw=true" height="480"><img src="https://github.com/ArtSabintsev/Siren/blob/master/Assets/picSkippedUpdate.png?raw=true" height="480">
|
||||
|
||||
|
||||
## Installation Instructions
|
||||
|
||||
### CocoaPods
|
||||
For Swift 3 support:
|
||||
```ruby
|
||||
pod 'Siren'
|
||||
```
|
||||
|
||||
- Requires [CocoaPods 0.36 prerelease](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/) or later
|
||||
- Only for apps with a minimum deployment target of iOS 8.0 or later
|
||||
For Swift 2.3 support:
|
||||
```ruby
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift2.3'
|
||||
```
|
||||
|
||||
> CocoaPods does not support pods written in Swift on iOS 7. For more information, please see [this issue](https://github.com/CocoaPods/swift/issues/22).
|
||||
|
||||
If your app needs to support iOS 7, use **Manual Installation**.
|
||||
For Swift 2.2 support:
|
||||
```ruby
|
||||
pod 'Siren', '0.9.5'
|
||||
```
|
||||
|
||||
#### Manual Installation
|
||||
### Carthage
|
||||
For Swift 3 support:
|
||||
|
||||
1. [Download Siren](//github.com/ArtSabintsev/Siren/archive/master.zip).
|
||||
2. Copy the `Siren` folder into your project.
|
||||
``` swift
|
||||
github "ArtSabintsev/Siren"
|
||||
```
|
||||
|
||||
### Setup Instructions
|
||||
For Swift 2.3 support:
|
||||
|
||||
Here's some commented sample code. Adapt this to meet your app's needs.
|
||||
``` swift
|
||||
github "ArtSabintsev/Siren" "swift2.3"
|
||||
```
|
||||
|
||||
### Swift Package Manager
|
||||
```swift
|
||||
.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 2)
|
||||
```
|
||||
|
||||
## 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/SirenExample/SirenExample/AppDelegate.swift in the Sample Project.
|
||||
|
||||
```Swift
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
|
||||
{
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
/* Siren code should go below window?.makeKeyAndVisible() */
|
||||
|
||||
// Siren is a singleton
|
||||
let siren = Siren.SharedInstance()
|
||||
|
||||
// Required: Your app's iTunes App Store ID
|
||||
siren.appID = <#Your_App_ID#>
|
||||
|
||||
// Required on iOS 8: The controller to present the alert from (usually the UIWindow's rootViewController)
|
||||
siren.presentingViewController = window?.rootViewController
|
||||
|
||||
// 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(.Immediately)
|
||||
|
||||
// Siren is a singleton
|
||||
let siren = Siren.shared
|
||||
|
||||
// Optional: Defaults to .option
|
||||
siren.alertType = <#Siren.AlertType_Enum_Value#>
|
||||
|
||||
// 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.
|
||||
siren.checkVersion(checkType: .immediately)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication)
|
||||
{
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
/*
|
||||
Perform daily (.Daily) or weekly (.Weekly) checks for new version of your app.
|
||||
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(.Daily)
|
||||
|
||||
Siren.shared.checkVersion(checkType: .daily)
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication)
|
||||
{
|
||||
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
|
||||
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.sharedInstance.checkVersion(.Immediately)
|
||||
Siren.shared.checkVersion(checkType: .immediately)
|
||||
}
|
||||
```
|
||||
|
||||
And you're all set!
|
||||
|
||||
### Screenshots & Alert Types
|
||||
|
||||
Siren can force an update, let the user optionally update, and allow the user to skip an update.
|
||||
|
||||
To control this behavior, assign a `SirenAlertType` to `alertType` (or one of the specific alert type properties).
|
||||
|
||||
> #### `siren.alertType = .Force`
|
||||
>
|
||||
> Forces the user to update.
|
||||
>
|
||||
> 
|
||||
> ----
|
||||
> #### `siren.alertType = .Option`
|
||||
> The default behavior.
|
||||
>
|
||||
> 
|
||||
> ----
|
||||
> #### `siren.alertType = .Skip`
|
||||
> Allows the user to opt out of future reminders for this version.
|
||||
>
|
||||
> 
|
||||
> ----
|
||||
> #### `siren.alertType = .None`
|
||||
>
|
||||
> This option doesn't show an alert view. It's useful for skipping Patch, Minor, or Major updates, or for presenting your own UI.
|
||||
|
||||
### 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:
|
||||
|
||||
```swift
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
|
||||
{
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
...
|
||||
siren.delegate = self
|
||||
siren.alertType = .None
|
||||
siren.alertType = .none
|
||||
...
|
||||
}
|
||||
|
||||
extension AppDelegate: SirenDelegate
|
||||
{
|
||||
extension AppDelegate: SirenDelegate {
|
||||
// Returns a localized message to this delegate method upon performing a successful version check
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
println("\(message)")
|
||||
print("\(message)")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
### Differentiated Alerts for Patch, Minor, and Major Updates
|
||||
If you would like to set a different type of alert for patch, minor, and/or major updates, simply add one or all of the following *optional* lines to your setup *before* calling the `checkVersion()` method:
|
||||
## 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:
|
||||
|
||||
```swift
|
||||
/* Siren defaults to SirenAlertType.Option for all updates */
|
||||
siren.sharedInstance().patchUpdateAlertType = <#SirenAlertType_Enum_Value#>
|
||||
siren.sharedInstance().minorUpdateAlertType = <#SirenAlertType_Enum_Value#>
|
||||
siren.sharedInstance().majorUpdateAlertType = <#SirenAlertType_Enum_Value#>
|
||||
/* 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
|
||||
Five delegate methods allow you to handle or track the user's behavior:
|
||||
## 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
|
||||
@objc protocol SirenDelegate {
|
||||
optional func sirenDidShowUpdateDialog() // User presented with update dialog
|
||||
optional func sirenUserDidLaunchAppStore() // User did click on button that launched App Store.app
|
||||
optional func sirenUserDidSkipVersion() // User did click on button that skips version update
|
||||
optional func sirenUserDidCancel() // User did click on button that cancels update dialog
|
||||
optional func sirenDidDetectNewVersionWithoutAlert(message: String) // Siren performed version check and did not display alert
|
||||
public protocol SirenDelegate: class {
|
||||
func sirenDidShowUpdateDialog(alertType: Siren.AlertType) // User presented with update dialog
|
||||
func sirenUserDidLaunchAppStore() // User did click on button that launched App Store.app
|
||||
func sirenUserDidSkipVersion() // User did click on button that skips version update
|
||||
func sirenUserDidCancel() // User did click on button that cancels update dialog
|
||||
func sirenDidFailVersionCheck(error: NSError) // Siren failed to perform version check (may return system-level error)
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) // Siren performed version check and did not display alert
|
||||
}
|
||||
```
|
||||
|
||||
### Force Localization
|
||||
Siren supports 18 languages: Basque, Chinese (Simplified), Chinese (Traditional), Danish, Dutch, English, French, German, Hebrew, Italian, Japanese, Korean, Portuguese, Russian, Slovenian, Swedish, Spanish, and Turkish.
|
||||
## 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
|
||||
- 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 this:
|
||||
You can enable it like so:
|
||||
|
||||
```swift
|
||||
Siren.sharedInstance.forceLanguageLocalization = SirenLanguageType.<#SirenLanguageType_Enum_Value#>
|
||||
Siren.shared.forceLanguageLocalization = Siren.LanguageType.<#Siren.LanguageType_Enum_Value#>
|
||||
```
|
||||
### How to test Siren
|
||||
Temporarily change the version string in Xcode 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.
|
||||
## 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 9 installed on their device, but the app update requires iOS 10, an alert will not be shown. This takes care of the *false positive* case regarding app updating.
|
||||
|
||||
### App Store Submissions
|
||||
## 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.
|
||||
|
||||
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 [iTunes Connect Mobile](https://itunes.apple.com/us/app/itunes-connect/id376771144?mt=8) app's bundleID: `com.apple.itunesconnect.mobile`.
|
||||
|
||||
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.
|
||||
|
||||
### Created and maintained by
|
||||
## Words of Caution
|
||||
Occasionally, the iTunes JSON will update faster than the App Store CDN, meaning the JSON may state that the new version of the app has been release, while no new binary is made available for download via the App Store. It is for this reason that Siren will, by default, wait 24 hours after the JSON has been updated to prompt the user to update. To change the default setting, please modify the value of `showAlertAfterCurrentVersionHasBeenReleasedForDays`.
|
||||
|
||||
## Ports
|
||||
- **Objective-C (iOS)**
|
||||
- [**Harpy**](http://github.com/ArtSabintsev/Harpy)
|
||||
- Siren was ported _from_ Harpy, as Siren and Harpy are maintained by the same developer.
|
||||
- **Java (Android)**
|
||||
- [**Egghead Games' Siren library**](https://github.com/eggheadgames/Siren)
|
||||
- The Siren Swift library inspired the Java library.
|
||||
- **React Native (iOS)**
|
||||
- [**Gant Laborde's Siren library**](https://github.com/GantMan/react-native-siren)
|
||||
- The Siren Swift library inspired the React Native library.
|
||||
|
||||
## Created and maintained by
|
||||
[Arthur Ariel Sabintsev](http://www.sabintsev.com/) & [Aaron Brager](http://twitter.com/getaaron)
|
||||
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
# Siren [English](README.md)
|
||||
|
||||
### 当您的 app 有新版本可用时提示用户进行更新。
|
||||
|
||||
[](https://travis-ci.org/ArtSabintsev/Siren) [](https://cocoapods.org/pods/Siren) [](https://github.com/Carthage/Carthage) [](https://swift.org/package-manager/) [](https://cocoapods.org/pods/Siren) [](https://cocoapods.org/pods/Siren)
|
||||
---
|
||||
|
||||
## 关于
|
||||
**Siren** 用于检测用户当前安装版本是否是 App Store 上的最新可用版本。
|
||||
|
||||
当 app 有更新时,Siren 会弹出提示框,用户可根据提示框提供的选项进行更新。或者您也可以根据 Siren 发出的消息来自定义通知用户的方式,比如您可以提供一个自定义的提示框。
|
||||
|
||||
- Siren 可配合 [**Semantic Versioning**](http://semver.org/) 系统使用
|
||||
- Semantic 版本系统由三位数字标识 (比如,1.0.0)
|
||||
- Siren 同时支持两位数字标识 (比如,1.0)
|
||||
- Siren 同时支持四位数字标识 (比如,1.0.0.0)
|
||||
- Siren 当前处于活跃维护状态,由[**Arthur Sabintsev**](http://github.com/ArtSabintsev) 和 [**Aaron Brager**](http://twitter.com/getaaron) 进行维护。
|
||||
|
||||
|
||||
## Ports
|
||||
- [**Harpy**](http://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` 枚举类型
|
||||
|
||||
<img src="https://github.com/ArtSabintsev/Harpy/blob/master/samplePictures/picForcedUpdate.png?raw=true" height=480">
|
||||
<img src="https://github.com/ArtSabintsev/Harpy/blob/master/samplePictures/picOptionalUpdate.png?raw=true" height=480">
|
||||
<img src="https://github.com/ArtSabintsev/Harpy/blob/master/samplePictures/picSkippedUpdate.png?raw=true" height=480">
|
||||
|
||||
## 安装指南
|
||||
|
||||
### 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](http://twitter.com/getaaron)
|
||||
|
||||
## 翻译人员
|
||||
[Daniel Hu](http://www.jianshu.com/u/d8bbc4831623)
|
||||
@@ -1,304 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8E1005E71A5DD02300509B14 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E1005DF1A5DD02300509B14 /* AppDelegate.swift */; };
|
||||
8E1005E81A5DD02300509B14 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8E1005E01A5DD02300509B14 /* LaunchScreen.xib */; };
|
||||
8E1005E91A5DD02300509B14 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8E1005E21A5DD02300509B14 /* Main.storyboard */; };
|
||||
8E1005EA1A5DD02300509B14 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8E1005E41A5DD02300509B14 /* Images.xcassets */; };
|
||||
8E1005EC1A5DD02300509B14 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E1005E61A5DD02300509B14 /* ViewController.swift */; };
|
||||
8E1005F01A5DD04500509B14 /* Siren.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8E1005EE1A5DD04500509B14 /* Siren.bundle */; };
|
||||
8E1005F11A5DD04500509B14 /* Siren.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E1005EF1A5DD04500509B14 /* Siren.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8E1005DF1A5DD02300509B14 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
8E1005E11A5DD02300509B14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
8E1005E31A5DD02300509B14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
8E1005E41A5DD02300509B14 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
8E1005E51A5DD02300509B14 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8E1005E61A5DD02300509B14 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
8E1005EE1A5DD04500509B14 /* Siren.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Siren.bundle; sourceTree = "<group>"; };
|
||||
8E1005EF1A5DD04500509B14 /* Siren.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Siren.swift; sourceTree = "<group>"; };
|
||||
8EC391811A58B465001C121E /* Sample App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sample App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8EC3917E1A58B465001C121E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
8E1005DE1A5DD02300509B14 /* Sample App */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8E1005ED1A5DD04500509B14 /* Siren */,
|
||||
8E1005DF1A5DD02300509B14 /* AppDelegate.swift */,
|
||||
8E1005E61A5DD02300509B14 /* ViewController.swift */,
|
||||
8E1005E01A5DD02300509B14 /* LaunchScreen.xib */,
|
||||
8E1005E21A5DD02300509B14 /* Main.storyboard */,
|
||||
8E1005E51A5DD02300509B14 /* Info.plist */,
|
||||
8E1005E41A5DD02300509B14 /* Images.xcassets */,
|
||||
);
|
||||
path = "Sample App";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8E1005ED1A5DD04500509B14 /* Siren */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8E1005EE1A5DD04500509B14 /* Siren.bundle */,
|
||||
8E1005EF1A5DD04500509B14 /* Siren.swift */,
|
||||
);
|
||||
name = Siren;
|
||||
path = ../../Siren;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391781A58B465001C121E = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8E1005DE1A5DD02300509B14 /* Sample App */,
|
||||
8EC391821A58B465001C121E /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391821A58B465001C121E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EC391811A58B465001C121E /* Sample App.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8EC391801A58B465001C121E /* Sample App */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "Sample App" */;
|
||||
buildPhases = (
|
||||
8EC3917D1A58B465001C121E /* Sources */,
|
||||
8EC3917E1A58B465001C121E /* Frameworks */,
|
||||
8EC3917F1A58B465001C121E /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Sample App";
|
||||
productName = Siren;
|
||||
productReference = 8EC391811A58B465001C121E /* Sample App.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
8EC391791A58B465001C121E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = "Sabintsev iOS Projects";
|
||||
TargetAttributes = {
|
||||
8EC391801A58B465001C121E = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "Sample App" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 8EC391781A58B465001C121E;
|
||||
productRefGroup = 8EC391821A58B465001C121E /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8EC391801A58B465001C121E /* Sample App */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8EC3917F1A58B465001C121E /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8E1005F01A5DD04500509B14 /* Siren.bundle in Resources */,
|
||||
8E1005EA1A5DD02300509B14 /* Images.xcassets in Resources */,
|
||||
8E1005E81A5DD02300509B14 /* LaunchScreen.xib in Resources */,
|
||||
8E1005E91A5DD02300509B14 /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8EC3917D1A58B465001C121E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8E1005EC1A5DD02300509B14 /* ViewController.swift in Sources */,
|
||||
8E1005F11A5DD04500509B14 /* Siren.swift in Sources */,
|
||||
8E1005E71A5DD02300509B14 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
8E1005E01A5DD02300509B14 /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8E1005E11A5DD02300509B14 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8E1005E21A5DD02300509B14 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8E1005E31A5DD02300509B14 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
8EC3919E1A58B466001C121E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EC3919F1A58B466001C121E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8EC391A11A58B466001C121E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Sample App/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_NAME = "Sample App";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EC391A21A58B466001C121E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Sample App/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_NAME = "Sample App";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "Sample App" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC3919E1A58B466001C121E /* Debug */,
|
||||
8EC3919F1A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "Sample App" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC391A11A58B466001C121E /* Debug */,
|
||||
8EC391A21A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 8EC391791A58B465001C121E /* Project object */;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
setupSiren()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func setupSiren() {
|
||||
|
||||
|
||||
let siren = Siren.sharedInstance
|
||||
|
||||
// Required
|
||||
siren.appID = "376771144" // For this example, we're using the iTunes Connect App (https://itunes.apple.com/us/app/itunes-connect/id376771144?mt=8)
|
||||
|
||||
// Required
|
||||
siren.presentingViewController = window?.rootViewController
|
||||
|
||||
// Optional
|
||||
siren.delegate = self
|
||||
|
||||
// Optional
|
||||
siren.debugEnabled = true;
|
||||
|
||||
// Optional
|
||||
siren.alertType = .Option
|
||||
|
||||
// Optional
|
||||
// siren.forceLanguageLocalization = .Spanish // Optional: Sets all messages to appear in spanish. Siren supports many other languages, not just English and Spanish.
|
||||
|
||||
// Required
|
||||
siren.checkVersion(.Immediately)
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate: SirenDelegate
|
||||
{
|
||||
func sirenDidShowUpdateDialog() {
|
||||
println("sirenDidShowUpdateDialog")
|
||||
}
|
||||
|
||||
func sirenUserDidCancel() {
|
||||
println("sirenUserDidCancel")
|
||||
}
|
||||
|
||||
func sirenUserDidSkipVersion() {
|
||||
println("sirenUserDidSkipVersion")
|
||||
}
|
||||
|
||||
func sirenUserDidLaunchAppStore() {
|
||||
println("sirenUserDidLaunchAppStore")
|
||||
}
|
||||
|
||||
/**
|
||||
This method is only hit when alertType is initialized to .None
|
||||
*/
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
println("\(message)")
|
||||
}
|
||||
}
|
||||
Regular → Executable
+6
-10
@@ -1,23 +1,19 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Siren"
|
||||
s.version = "0.2.2"
|
||||
s.version = "2.0.4"
|
||||
s.summary = "Notify users when a new version of your iOS app is available, and prompt them with the App Store link.."
|
||||
|
||||
s.description = <<-DESC
|
||||
Siren is checks a user’s currently installed version of your iOS app against the version that is currently available in the App Store. If a new version is available, an instance of UIAlertView (iOS 7) or UIAlertController (iOS 8) 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 system.
|
||||
Siren is a Swift port of Harpy, an Objective-C library that achieves the same functionality.
|
||||
Siren is actively maintained by Arthur Sabintsev and Aaron Brager.
|
||||
Siren is checks a user’s currently installed version of your iOS app against the version that is currently available in the App Store.
|
||||
DESC
|
||||
|
||||
s.homepage = "https://github.com/ArtSabintsev/Siren"
|
||||
s.license = "MIT"
|
||||
s.authors = { "Arthur Sabintsev" => "arthur@sabintsev.com", "Aaron Brager" => "getaaron@gmail.com" }
|
||||
s.authors = { "Arthur Ariel Sabintsev" => "arthur@sabintsev.com", "Aaron Brager" => "getaaron@gmail.com" }
|
||||
s.platform = :ios, "8.0"
|
||||
s.source = { :git => "https://github.com/ArtSabintsev/Siren.git", :tag => "0.2.2" }
|
||||
s.source_files = 'Siren/Siren.swift'
|
||||
s.resources = 'Siren/Siren.bundle'
|
||||
s.source = { :git => "https://github.com/ArtSabintsev/Siren.git", :tag => s.version.to_s }
|
||||
s.source_files = 'Sources/*.swift'
|
||||
s.resources = 'Sources/Siren.bundle'
|
||||
s.requires_arc = true
|
||||
|
||||
end
|
||||
|
||||
@@ -1,637 +0,0 @@
|
||||
//
|
||||
// Siren.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
// MARK: SirenDelegate Protocol
|
||||
@objc protocol SirenDelegate {
|
||||
optional func sirenDidShowUpdateDialog() // User presented with update dialog
|
||||
optional func sirenUserDidLaunchAppStore() // User did click on button that launched App Store.app
|
||||
optional func sirenUserDidSkipVersion() // User did click on button that skips version update
|
||||
optional func sirenUserDidCancel() // User did click on button that cancels update dialog
|
||||
optional func sirenDidDetectNewVersionWithoutAlert(message: String) // Siren performed version check and did not display alert
|
||||
}
|
||||
|
||||
// MARK: Enumerations
|
||||
/**
|
||||
Determines the type of alert to present after a successful version check has been performed.
|
||||
|
||||
There are four options:
|
||||
- Force: Forces user to update your app (1 button alert)
|
||||
- Option: (DEFAULT) Presents user with option to update app now or at next launch (2 button alert)
|
||||
- Skip: Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert)
|
||||
- None: Doesn't show the alert, but instead returns a localized message for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method
|
||||
|
||||
*/
|
||||
public enum SirenAlertType
|
||||
{
|
||||
case Force // Forces user to update your app (1 button alert)
|
||||
case Option // (DEFAULT) Presents user with option to update app now or at next launch (2 button alert)
|
||||
case Skip // Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert)
|
||||
case None // Doesn't show the alert, but instead returns a localized message for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method
|
||||
}
|
||||
|
||||
/**
|
||||
Determines the frequency in which the the version check is performed
|
||||
|
||||
- .Immediately: Version check performed every time the app is launched
|
||||
- .Daily: Version check performedonce a day
|
||||
- .Weekly: Version check performed once a week
|
||||
|
||||
*/
|
||||
public enum SirenVersionCheckType : Int
|
||||
{
|
||||
case Immediately = 0 // Version check performed every time the app is launched
|
||||
case Daily = 1 // Version check performed once a day
|
||||
case Weekly = 7 // Version check performed once a week
|
||||
}
|
||||
|
||||
/**
|
||||
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()
|
||||
|
||||
Supported languages:
|
||||
- Basque
|
||||
- ChineseSimplified
|
||||
- ChineseTraditional
|
||||
- Danish
|
||||
- Dutch
|
||||
- English
|
||||
- French
|
||||
- Hebrew
|
||||
- German
|
||||
- Italian
|
||||
- Japanese
|
||||
- Korean
|
||||
- Portuguese
|
||||
- Russian
|
||||
- Slovenian
|
||||
- Spanish
|
||||
- Swedish
|
||||
- Turkish
|
||||
|
||||
*/
|
||||
public enum SirenLanguageType: String
|
||||
{
|
||||
case Basque = "eu"
|
||||
case ChineseSimplified = "zh-Hans"
|
||||
case ChineseTraditional = "zh-Hant"
|
||||
case Danish = "da"
|
||||
case Dutch = "nl"
|
||||
case English = "en"
|
||||
case French = "fr"
|
||||
case Hebrew = "he"
|
||||
case German = "de"
|
||||
case Italian = "it"
|
||||
case Japanese = "ja"
|
||||
case Korean = "ko"
|
||||
case Portuguese = "pt"
|
||||
case Russian = "ru"
|
||||
case Slovenian = "sl"
|
||||
case Spanish = "es"
|
||||
case Swedish = "sv"
|
||||
case Turkish = "tr"
|
||||
}
|
||||
|
||||
// MARK: Siren
|
||||
/**
|
||||
The Siren Class.
|
||||
|
||||
A singleton that is initialized using the sharedInstance() method.
|
||||
*/
|
||||
public class Siren: NSObject
|
||||
{
|
||||
|
||||
// MARK: Constants
|
||||
// NSUserDefault key that stores the timestamp of the last version check
|
||||
let sirenDefaultStoredVersionCheckDate = "Siren Stored Date From Last Version Check"
|
||||
|
||||
// NSUserDefault key that stores the version that a user decided to skip
|
||||
let sirenDefaultSkippedVersion = "Siren User Decided To Skip Version Update"
|
||||
|
||||
// Current installed version of your app
|
||||
let currentInstalledVersion = NSBundle.mainBundle().currentInstalledVersion()
|
||||
|
||||
// NSBundle path for localization
|
||||
let bundlePath = NSBundle.mainBundle().pathForResource("Siren", ofType: "Bundle")
|
||||
|
||||
// MARK: Variables
|
||||
/**
|
||||
The SirenDelegate variable, which should be set if you'd like to be notified:
|
||||
|
||||
- When a user views or interacts with the alert
|
||||
- sirenDidShowUpdateDialog()
|
||||
- sirenUserDidLaunchAppStore()
|
||||
- sirenUserDidSkipVersion()
|
||||
- sirenUserDidCancel()
|
||||
- When a new version has been detected, and you would like to present a localized message in a custom UI
|
||||
- sirenDidDetectNewVersionWithoutAlert(message: String)
|
||||
|
||||
*/
|
||||
weak var delegate: SirenDelegate?
|
||||
|
||||
/**
|
||||
The debug flag, which is disabled by default.
|
||||
|
||||
When enabled, a stream of println() statements are logged to your console when a version check is performed.
|
||||
*/
|
||||
var debugEnabled = false
|
||||
|
||||
// Alert Vars
|
||||
/**
|
||||
Determines the type of alert that should be shown.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
var alertType = SirenAlertType.Option
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for major version updates: A.b.c
|
||||
|
||||
When this property is nil, the value set for the general alertType property is used.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
var majorUpdateAlertType: SirenAlertType?
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for minor version updates: a.B.c
|
||||
|
||||
When this property is nil, the value set for the general alertType property is used.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
var minorUpdateAlertType: SirenAlertType?
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for minor patch updates: a.b.C
|
||||
|
||||
When this property is nil, the value set for the general alertType property is used.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
var patchUpdateAlertType: SirenAlertType?
|
||||
|
||||
// Required Vars
|
||||
/**
|
||||
The App Store / iTunes Connect ID for your app.
|
||||
*/
|
||||
var appID: String?
|
||||
|
||||
/**
|
||||
The view controller that will present the instance of UIAlertController.
|
||||
|
||||
It is recommended that you set this value to window?.rootViewController.
|
||||
|
||||
This property must be set before calling checkVersion().
|
||||
*/
|
||||
var presentingViewController: UIViewController?
|
||||
|
||||
// Optional Vars
|
||||
/**
|
||||
The name of your app.
|
||||
|
||||
By default, it's set to the name of the app that's stored in your plist.
|
||||
*/
|
||||
var appName: String = (NSBundle.mainBundle().infoDictionary?[kCFBundleNameKey] as? String) ?? ""
|
||||
|
||||
/**
|
||||
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, you should set it to the identifier
|
||||
of at least one App Store within which it is available.
|
||||
*/
|
||||
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 SirenLanguageType enum for more details.
|
||||
*/
|
||||
var forceLanguageLocalization: SirenLanguageType?
|
||||
|
||||
/**
|
||||
Overrides the tint color for UIAlertController.
|
||||
*/
|
||||
var alertControllerTintColor: UIColor?
|
||||
|
||||
// Private
|
||||
private var lastVersionCheckPerformedOnDate: NSDate?
|
||||
private var currentAppStoreVersion: String?
|
||||
|
||||
// MARK: Initialization
|
||||
public class var sharedInstance: Siren {
|
||||
struct Singleton {
|
||||
static let instance = Siren()
|
||||
}
|
||||
|
||||
return Singleton.instance
|
||||
}
|
||||
|
||||
override init() {
|
||||
lastVersionCheckPerformedOnDate = NSUserDefaults.standardUserDefaults().objectForKey(sirenDefaultStoredVersionCheckDate) as? NSDate;
|
||||
}
|
||||
|
||||
// MARK: Check Version
|
||||
/**
|
||||
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.
|
||||
|
||||
:param: checkType The frequency in days in which you want a check to be performed. Please refer to the SirenVersionCheckType enum for more details.
|
||||
*/
|
||||
func checkVersion(checkType: SirenVersionCheckType) {
|
||||
|
||||
if (appID == nil) {
|
||||
println("[Siren] Please make sure that you have set 'appID' before calling checkVersion.")
|
||||
} else if (useAlertController && presentingViewController == nil) { // iOS 8 only
|
||||
println("[Siren] Please make sure that you have set 'presentingViewController' before calling checkVersion.")
|
||||
} else {
|
||||
if checkType == .Immediately {
|
||||
performVersionCheck()
|
||||
} else {
|
||||
if let lastCheckDate = lastVersionCheckPerformedOnDate {
|
||||
if daysSinceLastVersionCheckDate() >= checkType.rawValue {
|
||||
performVersionCheck()
|
||||
}
|
||||
} else {
|
||||
performVersionCheck()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func performVersionCheck() {
|
||||
|
||||
// Create Request
|
||||
let itunesURL = iTunesURLFromString()
|
||||
let request = NSMutableURLRequest(URL: itunesURL)
|
||||
request.HTTPMethod = "GET"
|
||||
|
||||
// Perform Request
|
||||
let session = NSURLSession.sharedSession()
|
||||
let task = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
|
||||
|
||||
if data.length > 0 {
|
||||
|
||||
// Convert JSON data to Swift Dictionary of type [String : AnyObject]
|
||||
let appData = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments, error: nil) as? [String: AnyObject]
|
||||
|
||||
if let appData = appData {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), { () -> Void in
|
||||
|
||||
// Print iTunesLookup results from appData
|
||||
if self.debugEnabled {
|
||||
println("[Siren] JSON results: \(appData)");
|
||||
}
|
||||
|
||||
// Process Results (e.g., extract current version on the AppStore)
|
||||
self.processVersionCheckResults(appData)
|
||||
|
||||
})
|
||||
|
||||
} else { // appData == nil
|
||||
if self.debugEnabled {
|
||||
println("[Siren] Error retrieving App Store data as data was nil: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
|
||||
} else { // data.length == 0
|
||||
if self.debugEnabled {
|
||||
println("[Siren] Error retrieving App Store data as no data was returned: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
task.resume()
|
||||
}
|
||||
|
||||
private func processVersionCheckResults(lookupResults: [String: AnyObject]) {
|
||||
|
||||
// Store version comparison date
|
||||
self.storeVersionCheckDate()
|
||||
|
||||
let results = lookupResults["results"] as? [[String: AnyObject]]
|
||||
if let results = results {
|
||||
if results.isEmpty == false { // Conditional that avoids crash when app not in App Store or appID mistyped
|
||||
self.currentAppStoreVersion = results[0]["version"] as? String
|
||||
if let currentAppStoreVersion = self.currentAppStoreVersion {
|
||||
if self.isAppStoreVersionNewer() {
|
||||
self.showAlertIfCurrentAppStoreVersionNotSkipped()
|
||||
} else {
|
||||
if self.debugEnabled {
|
||||
println("[Siren] App Store version of app is not newer")
|
||||
}
|
||||
}
|
||||
} else { // lookupResults["results"][0] does not contain "version" key
|
||||
if self.debugEnabled {
|
||||
println("[Siren] Error retrieving App Store verson number as results[0] does not contain a 'version' key")
|
||||
}
|
||||
}
|
||||
} else { // lookupResults does not contain any data as the returned array is empty
|
||||
if self.debugEnabled {
|
||||
println("[Siren] Error retrieving App Store verson number as results returns an empty array")
|
||||
}
|
||||
}
|
||||
} else { // lookupResults does not contain any data
|
||||
if self.debugEnabled {
|
||||
println("[Siren] Error retrieving App Store verson number as there was no data returned")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Alert
|
||||
private extension Siren {
|
||||
func showAlertIfCurrentAppStoreVersionNotSkipped() {
|
||||
|
||||
self.alertType = self.setAlertType()
|
||||
|
||||
if let previouslySkippedVersion = NSUserDefaults.standardUserDefaults().objectForKey(sirenDefaultSkippedVersion) as? String {
|
||||
if currentAppStoreVersion! != previouslySkippedVersion {
|
||||
showAlert()
|
||||
}
|
||||
} else {
|
||||
showAlert()
|
||||
}
|
||||
}
|
||||
|
||||
func showAlert() {
|
||||
|
||||
let updateAvailableMessage = NSBundle().localizedString("Update Available", forceLanguageLocalization: forceLanguageLocalization)
|
||||
var newVersionMessage = localizedNewVersionMessage();
|
||||
|
||||
if (useAlertController) { // iOS 8
|
||||
|
||||
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:
|
||||
delegate?.sirenDidDetectNewVersionWithoutAlert?(newVersionMessage)
|
||||
}
|
||||
|
||||
if alertType != .None {
|
||||
presentingViewController?.presentViewController(alertController, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
} else { // iOS 7
|
||||
|
||||
var alertView: UIAlertView?
|
||||
let updateButtonTitle = localizedUpdateButtonTitle()
|
||||
let nextTimeButtonTitle = localizedNextTimeButtonTitle()
|
||||
let skipButtonTitle = localizedSkipButtonTitle()
|
||||
switch alertType {
|
||||
case .Force:
|
||||
alertView = UIAlertView(title: updateAvailableMessage, message: newVersionMessage, delegate: self, cancelButtonTitle: updateButtonTitle)
|
||||
case .Option:
|
||||
alertView = UIAlertView(title: updateAvailableMessage, message: newVersionMessage, delegate: self, cancelButtonTitle: nextTimeButtonTitle)
|
||||
alertView!.addButtonWithTitle(updateButtonTitle)
|
||||
case .Skip:
|
||||
alertView = UIAlertView(title: updateAvailableMessage, message: newVersionMessage, delegate: self, cancelButtonTitle: skipButtonTitle)
|
||||
alertView!.addButtonWithTitle(updateButtonTitle)
|
||||
alertView!.addButtonWithTitle(nextTimeButtonTitle)
|
||||
case .None:
|
||||
delegate?.sirenDidDetectNewVersionWithoutAlert?(newVersionMessage)
|
||||
}
|
||||
|
||||
if let alertView = alertView {
|
||||
alertView.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func updateAlertAction() -> UIAlertAction {
|
||||
let title = localizedUpdateButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .Default) { (alert: UIAlertAction!) -> Void in
|
||||
self.launchAppStore()
|
||||
self.delegate?.sirenUserDidLaunchAppStore?()
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func nextTimeAlertAction() -> UIAlertAction {
|
||||
let title = localizedNextTimeButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .Default) { (alert: UIAlertAction!) -> Void in
|
||||
self.delegate?.sirenUserDidCancel?()
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func skipAlertAction() -> UIAlertAction {
|
||||
let title = localizedSkipButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .Default) { (alert: UIAlertAction!) -> Void in
|
||||
self.delegate?.sirenUserDidSkipVersion?()
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Helpers
|
||||
private extension Siren {
|
||||
|
||||
func iTunesURLFromString() -> NSURL {
|
||||
|
||||
var storeURLString = "https://itunes.apple.com/lookup?id=\(appID!)"
|
||||
|
||||
if let countryCode = countryCode {
|
||||
storeURLString += "&country=\(countryCode)"
|
||||
}
|
||||
|
||||
if debugEnabled {
|
||||
println("[Siren] iTunes Lookup URL: \(storeURLString)");
|
||||
}
|
||||
|
||||
return NSURL(string: storeURLString)!
|
||||
}
|
||||
|
||||
func daysSinceLastVersionCheckDate() -> Int {
|
||||
let calendar = NSCalendar.currentCalendar()
|
||||
let components = calendar.components(.CalendarUnitDay, fromDate: NSDate(), toDate: lastVersionCheckPerformedOnDate!, options: nil)
|
||||
return components.day
|
||||
}
|
||||
|
||||
func isAppStoreVersionNewer() -> Bool {
|
||||
|
||||
var newVersionExists = false
|
||||
|
||||
if let currentInstalledVersion = self.currentInstalledVersion {
|
||||
if (currentInstalledVersion.compare(currentAppStoreVersion!, options: .NumericSearch) == NSComparisonResult.OrderedAscending) {
|
||||
newVersionExists = true
|
||||
}
|
||||
}
|
||||
|
||||
return newVersionExists
|
||||
}
|
||||
|
||||
func storeVersionCheckDate() {
|
||||
lastVersionCheckPerformedOnDate = NSDate()
|
||||
if let lastVersionCheckPerformedOnDate = self.lastVersionCheckPerformedOnDate {
|
||||
NSUserDefaults.standardUserDefaults().setObject(self.lastVersionCheckPerformedOnDate!, forKey: self.sirenDefaultStoredVersionCheckDate)
|
||||
NSUserDefaults.standardUserDefaults().synchronize()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: Potentially turn this into a custom setter/getter with property observers
|
||||
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Properties.html#//apple_ref/doc/uid/TP40014097-CH14-ID262
|
||||
*/
|
||||
func setAlertType() -> SirenAlertType {
|
||||
|
||||
if majorUpdateAlertType == nil {
|
||||
majorUpdateAlertType = alertType
|
||||
}
|
||||
|
||||
if minorUpdateAlertType == nil {
|
||||
minorUpdateAlertType = alertType
|
||||
}
|
||||
|
||||
if patchUpdateAlertType == nil {
|
||||
patchUpdateAlertType = alertType
|
||||
}
|
||||
|
||||
let oldVersion = split(currentInstalledVersion!, {$0 == "."}, maxSplit: Int.max, allowEmptySlices: false).map {$0.toInt() ?? 0}
|
||||
let newVersion = split(currentAppStoreVersion!, {$0 == "."}, maxSplit: Int.max, allowEmptySlices: false).map {$0.toInt() ?? 0}
|
||||
|
||||
if oldVersion.count == 3 && newVersion.count == 3 {
|
||||
if newVersion[0] > oldVersion[0] { // A.b.c
|
||||
alertType = majorUpdateAlertType!
|
||||
} else if newVersion[1] > oldVersion[1] { // a.B.c
|
||||
alertType = minorUpdateAlertType!
|
||||
} else if newVersion[2] > oldVersion[2] { // a.b.C
|
||||
alertType = patchUpdateAlertType!
|
||||
}
|
||||
}
|
||||
|
||||
return alertType
|
||||
}
|
||||
|
||||
// iOS 8 Compatibility Check
|
||||
var useAlertController: Bool { // iOS 8 check
|
||||
return objc_getClass("UIAlertController") != nil
|
||||
}
|
||||
|
||||
// Actions
|
||||
func launchAppStore() {
|
||||
let iTunesString = "https://itunes.apple.com/app/id\(appID)";
|
||||
let iTunesURL = NSURL(string: iTunesString);
|
||||
UIApplication.sharedApplication().openURL(iTunesURL!);
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: String Localization
|
||||
private extension Siren {
|
||||
|
||||
func localizedNewVersionMessage() -> String {
|
||||
|
||||
let newVersionMessageToLocalize = "A new version of %@ is available. Please update to version %@ now."
|
||||
var newVersionMessage = NSBundle().localizedString(newVersionMessageToLocalize, forceLanguageLocalization: forceLanguageLocalization)
|
||||
newVersionMessage = String(format: newVersionMessage!, appName, currentAppStoreVersion!)
|
||||
|
||||
return newVersionMessage!
|
||||
}
|
||||
|
||||
func localizedUpdateButtonTitle() -> String {
|
||||
return NSBundle().localizedString("Update", forceLanguageLocalization: forceLanguageLocalization)!
|
||||
}
|
||||
|
||||
func localizedNextTimeButtonTitle() -> String {
|
||||
return NSBundle().localizedString("Next time", forceLanguageLocalization: forceLanguageLocalization)!
|
||||
}
|
||||
|
||||
func localizedSkipButtonTitle() -> String {
|
||||
return NSBundle().localizedString("Skip this version", forceLanguageLocalization: forceLanguageLocalization)!;
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: NSBundle Extension
|
||||
private extension NSBundle {
|
||||
|
||||
func currentInstalledVersion() -> String? {
|
||||
return NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as? String
|
||||
}
|
||||
|
||||
func sirenBundlePath() -> String {
|
||||
return NSBundle.mainBundle().pathForResource("Siren", ofType: "bundle") as String!
|
||||
}
|
||||
|
||||
func sirenForcedBundlePath(forceLanguageLocalization: SirenLanguageType) -> String {
|
||||
let path = sirenBundlePath()
|
||||
let name = forceLanguageLocalization.rawValue
|
||||
return NSBundle(path: path)!.pathForResource(name, ofType: "lproj")!
|
||||
}
|
||||
|
||||
func localizedString(stringKey: String, forceLanguageLocalization: SirenLanguageType?) -> String? {
|
||||
var path: String
|
||||
let table = "SirenLocalizable"
|
||||
if let forceLanguageLocalization = forceLanguageLocalization {
|
||||
path = sirenForcedBundlePath(forceLanguageLocalization)
|
||||
} else {
|
||||
path = sirenBundlePath()
|
||||
}
|
||||
|
||||
return NSBundle(path: path)?.localizedStringForKey(stringKey, value: stringKey, table: table)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UIAlertViewDelegate
|
||||
extension Siren: UIAlertViewDelegate
|
||||
{
|
||||
public func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) {
|
||||
|
||||
switch alertType {
|
||||
|
||||
case .Force:
|
||||
launchAppStore()
|
||||
case .Option:
|
||||
if buttonIndex == 1 { // Launch App Store.app
|
||||
launchAppStore()
|
||||
self.delegate?.sirenUserDidLaunchAppStore?()
|
||||
} else { // Ask user on next launch
|
||||
self.delegate?.sirenUserDidCancel?()
|
||||
}
|
||||
case .Skip:
|
||||
if buttonIndex == 0 { // Launch App Store.app
|
||||
NSUserDefaults.standardUserDefaults().setObject(currentAppStoreVersion!, forKey: sirenDefaultSkippedVersion)
|
||||
NSUserDefaults.standardUserDefaults().synchronize()
|
||||
self.delegate?.sirenUserDidSkipVersion?()
|
||||
} else if buttonIndex == 1 {
|
||||
launchAppStore()
|
||||
self.delegate?.sirenUserDidLaunchAppStore?()
|
||||
} else if buttonIndex == 2 { // Ask user on next launch
|
||||
self.delegate?.sirenUserDidCancel?()
|
||||
}
|
||||
case .None:
|
||||
if debugEnabled {
|
||||
println("[Siren] No alert presented due to alertType == .None")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Siren.h
|
||||
// Siren
|
||||
//
|
||||
// Created by Sabintsev, Arthur on 3/4/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for Siren.
|
||||
FOUNDATION_EXPORT double SirenVersionNumber;
|
||||
|
||||
//! Project version string for Siren.
|
||||
FOUNDATION_EXPORT const unsigned char SirenVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Siren/PublicHeader.h>
|
||||
|
||||
|
||||
+658
@@ -0,0 +1,658 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
55EC364B1E6BB98A00726F13 /* Siren.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC36491E6BB98A00726F13 /* Siren.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
55EC364E1E6BB98A00726F13 /* Siren.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55EC36471E6BB98A00726F13 /* Siren.framework */; };
|
||||
55EC364F1E6BB98A00726F13 /* Siren.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 55EC36471E6BB98A00726F13 /* Siren.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
55EC36601E6BB99B00726F13 /* Siren.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 55EC365E1E6BB99B00726F13 /* Siren.bundle */; };
|
||||
55EC36611E6BB99B00726F13 /* Siren.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55EC365F1E6BB99B00726F13 /* Siren.swift */; };
|
||||
8E1635A91E6A0B9C0060CE27 /* SirenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */; };
|
||||
8E43D6231E8223EE00ECFFC8 /* SirenDateExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E43D6221E8223EE00ECFFC8 /* SirenDateExtension.swift */; };
|
||||
8E528A301E989A7A00B643C4 /* SirenDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E528A2F1E989A7A00B643C4 /* SirenDelegate.swift */; };
|
||||
8E528A321E989E0A00B643C4 /* SirenTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E528A311E989E0A00B643C4 /* SirenTestHelper.swift */; };
|
||||
8E9C238B1E7CDB42000ED3DA /* SirenBundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9C238A1E7CDB42000ED3DA /* SirenBundleExtension.swift */; };
|
||||
8E9C238D1E7CDD31000ED3DA /* SirenUIAlertControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9C238C1E7CDD31000ED3DA /* SirenUIAlertControllerExtension.swift */; };
|
||||
8E9C238F1E7CDDE7000ED3DA /* SirenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E9C238E1E7CDDE7000ED3DA /* SirenViewController.swift */; };
|
||||
8EBDF8251E6A0C41006C87B4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8EBDF8211E6A0C41006C87B4 /* LaunchScreen.xib */; };
|
||||
8EBDF8261E6A0C41006C87B4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8EBDF8231E6A0C41006C87B4 /* Main.storyboard */; };
|
||||
8EE6C7431E6A0AA500DBE454 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6C7411E6A0AA500DBE454 /* AppDelegate.swift */; };
|
||||
8EE6C7441E6A0AA500DBE454 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6C7421E6A0AA500DBE454 /* ViewController.swift */; };
|
||||
8EE6C7481E6A0AB800DBE454 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8EE6C7461E6A0AB800DBE454 /* Images.xcassets */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
55EC364C1E6BB98A00726F13 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 8EC391791A58B465001C121E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 55EC36461E6BB98A00726F13;
|
||||
remoteInfo = Siren;
|
||||
};
|
||||
8E3A6C091D07CB6F00A8B7CF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 8EC391791A58B465001C121E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8EC391801A58B465001C121E;
|
||||
remoteInfo = "Sample App";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
558455D81C6690B4004BE492 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
55EC364F1E6BB98A00726F13 /* Siren.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
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 = "<group>"; };
|
||||
55EC364A1E6BB98A00726F13 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
55EC365E1E6BB99B00726F13 /* Siren.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Siren.bundle; path = ../../Sources/Siren.bundle; sourceTree = "<group>"; };
|
||||
55EC365F1E6BB99B00726F13 /* Siren.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Siren.swift; path = ../../Sources/Siren.swift; sourceTree = "<group>"; };
|
||||
8E3A6C041D07CB6F00A8B7CF /* SirenExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SirenExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8E43D6221E8223EE00ECFFC8 /* SirenDateExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenDateExtension.swift; path = ../../Sources/SirenDateExtension.swift; sourceTree = "<group>"; };
|
||||
8E528A2F1E989A7A00B643C4 /* SirenDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenDelegate.swift; path = ../../Sources/SirenDelegate.swift; sourceTree = "<group>"; };
|
||||
8E528A311E989E0A00B643C4 /* SirenTestHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenTestHelper.swift; path = ../../Sources/SirenTestHelper.swift; sourceTree = "<group>"; };
|
||||
8E9C238A1E7CDB42000ED3DA /* SirenBundleExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenBundleExtension.swift; path = ../../Sources/SirenBundleExtension.swift; sourceTree = "<group>"; };
|
||||
8E9C238C1E7CDD31000ED3DA /* SirenUIAlertControllerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenUIAlertControllerExtension.swift; path = ../../Sources/SirenUIAlertControllerExtension.swift; sourceTree = "<group>"; };
|
||||
8E9C238E1E7CDDE7000ED3DA /* SirenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SirenViewController.swift; path = ../../Sources/SirenViewController.swift; sourceTree = "<group>"; };
|
||||
8EBDF8221E6A0C41006C87B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = SirenExample/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; };
|
||||
8EBDF8241E6A0C41006C87B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = SirenExample/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; };
|
||||
8EC391811A58B465001C121E /* SirenExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SirenExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8EE6C7411E6A0AA500DBE454 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = SirenExample/AppDelegate.swift; sourceTree = SOURCE_ROOT; };
|
||||
8EE6C7421E6A0AA500DBE454 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = SirenExample/ViewController.swift; sourceTree = SOURCE_ROOT; };
|
||||
8EE6C7461E6A0AB800DBE454 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SirenExample/Images.xcassets; sourceTree = SOURCE_ROOT; };
|
||||
8EE6C7471E6A0AB800DBE454 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SirenExample/Info.plist; sourceTree = SOURCE_ROOT; };
|
||||
8EE6C74B1E6A0AE100DBE454 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenTests.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
55EC36431E6BB98A00726F13 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8E3A6C011D07CB6F00A8B7CF /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917E1A58B465001C121E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
55EC364E1E6BB98A00726F13 /* Siren.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
55EC36481E6BB98A00726F13 /* Siren */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
55EC365E1E6BB99B00726F13 /* Siren.bundle */,
|
||||
55EC365F1E6BB99B00726F13 /* Siren.swift */,
|
||||
8E528A2F1E989A7A00B643C4 /* SirenDelegate.swift */,
|
||||
8E9C238A1E7CDB42000ED3DA /* SirenBundleExtension.swift */,
|
||||
8E43D6221E8223EE00ECFFC8 /* SirenDateExtension.swift */,
|
||||
8E528A311E989E0A00B643C4 /* SirenTestHelper.swift */,
|
||||
8E9C238C1E7CDD31000ED3DA /* SirenUIAlertControllerExtension.swift */,
|
||||
8E9C238E1E7CDDE7000ED3DA /* SirenViewController.swift */,
|
||||
55EC36491E6BB98A00726F13 /* Siren.h */,
|
||||
55EC364A1E6BB98A00726F13 /* Info.plist */,
|
||||
);
|
||||
path = Siren;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8E1005DE1A5DD02300509B14 /* SirenExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EE6C7411E6A0AA500DBE454 /* AppDelegate.swift */,
|
||||
8E528A331E98AED300B643C4 /* Supporting Files */,
|
||||
);
|
||||
name = SirenExample;
|
||||
path = "Sample App";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8E528A331E98AED300B643C4 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EE6C7421E6A0AA500DBE454 /* ViewController.swift */,
|
||||
8EBDF8211E6A0C41006C87B4 /* LaunchScreen.xib */,
|
||||
8EBDF8231E6A0C41006C87B4 /* Main.storyboard */,
|
||||
8EE6C7461E6A0AB800DBE454 /* Images.xcassets */,
|
||||
8EE6C7471E6A0AB800DBE454 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391781A58B465001C121E = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8E1005DE1A5DD02300509B14 /* SirenExample */,
|
||||
8EE6C74A1E6A0AE100DBE454 /* SirenExampleTests */,
|
||||
55EC36481E6BB98A00726F13 /* Siren */,
|
||||
8EC391821A58B465001C121E /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391821A58B465001C121E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EC391811A58B465001C121E /* SirenExample.app */,
|
||||
8E3A6C041D07CB6F00A8B7CF /* SirenExampleTests.xctest */,
|
||||
55EC36471E6BB98A00726F13 /* Siren.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EE6C74A1E6A0AE100DBE454 /* SirenExampleTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EE6C74B1E6A0AE100DBE454 /* Info.plist */,
|
||||
8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */,
|
||||
);
|
||||
path = SirenExampleTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
55EC36441E6BB98A00726F13 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
55EC364B1E6BB98A00726F13 /* Siren.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
55EC36461E6BB98A00726F13 /* Siren */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 55EC36521E6BB98A00726F13 /* Build configuration list for PBXNativeTarget "Siren" */;
|
||||
buildPhases = (
|
||||
55EC36421E6BB98A00726F13 /* Sources */,
|
||||
55EC36431E6BB98A00726F13 /* Frameworks */,
|
||||
55EC36441E6BB98A00726F13 /* Headers */,
|
||||
55EC36451E6BB98A00726F13 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Siren;
|
||||
productName = Siren;
|
||||
productReference = 55EC36471E6BB98A00726F13 /* Siren.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
8E3A6C031D07CB6F00A8B7CF /* SirenExampleTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8E3A6C0D1D07CB6F00A8B7CF /* Build configuration list for PBXNativeTarget "SirenExampleTests" */;
|
||||
buildPhases = (
|
||||
8E3A6C001D07CB6F00A8B7CF /* Sources */,
|
||||
8E3A6C011D07CB6F00A8B7CF /* Frameworks */,
|
||||
8E3A6C021D07CB6F00A8B7CF /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8E3A6C0A1D07CB6F00A8B7CF /* PBXTargetDependency */,
|
||||
);
|
||||
name = SirenExampleTests;
|
||||
productName = SirenTests;
|
||||
productReference = 8E3A6C041D07CB6F00A8B7CF /* SirenExampleTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
8EC391801A58B465001C121E /* SirenExample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "SirenExample" */;
|
||||
buildPhases = (
|
||||
8EC3917D1A58B465001C121E /* Sources */,
|
||||
8EC3917E1A58B465001C121E /* Frameworks */,
|
||||
8EE3A3F81E6A0E470010BDCE /* SwiftLint */,
|
||||
8EC3917F1A58B465001C121E /* Resources */,
|
||||
558455D81C6690B4004BE492 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
55EC364D1E6BB98A00726F13 /* PBXTargetDependency */,
|
||||
);
|
||||
name = SirenExample;
|
||||
productName = Siren;
|
||||
productReference = 8EC391811A58B465001C121E /* SirenExample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
8EC391791A58B465001C121E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0820;
|
||||
ORGANIZATIONNAME = "Sabintsev iOS Projects";
|
||||
TargetAttributes = {
|
||||
55EC36461E6BB98A00726F13 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
LastSwiftMigration = 0820;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
8E3A6C031D07CB6F00A8B7CF = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 0800;
|
||||
TestTargetID = 8EC391801A58B465001C121E;
|
||||
};
|
||||
8EC391801A58B465001C121E = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
DevelopmentTeam = HT94948NDD;
|
||||
DevelopmentTeamName = "Arthur Sabintsev";
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "SirenExample" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 8EC391781A58B465001C121E;
|
||||
productRefGroup = 8EC391821A58B465001C121E /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8EC391801A58B465001C121E /* SirenExample */,
|
||||
8E3A6C031D07CB6F00A8B7CF /* SirenExampleTests */,
|
||||
55EC36461E6BB98A00726F13 /* Siren */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
55EC36451E6BB98A00726F13 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
55EC36601E6BB99B00726F13 /* Siren.bundle in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8E3A6C021D07CB6F00A8B7CF /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917F1A58B465001C121E /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EBDF8261E6A0C41006C87B4 /* Main.storyboard in Resources */,
|
||||
8EBDF8251E6A0C41006C87B4 /* LaunchScreen.xib in Resources */,
|
||||
8EE6C7481E6A0AB800DBE454 /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
8EE3A3F81E6A0E470010BDCE /* SwiftLint */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = SwiftLint;
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "if which swiftlint >/dev/null; then\nswiftlint lint --config ../.swiftlint.yml\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
55EC36421E6BB98A00726F13 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8E528A321E989E0A00B643C4 /* SirenTestHelper.swift in Sources */,
|
||||
8E9C238F1E7CDDE7000ED3DA /* SirenViewController.swift in Sources */,
|
||||
55EC36611E6BB99B00726F13 /* Siren.swift in Sources */,
|
||||
8E43D6231E8223EE00ECFFC8 /* SirenDateExtension.swift in Sources */,
|
||||
8E9C238B1E7CDB42000ED3DA /* SirenBundleExtension.swift in Sources */,
|
||||
8E528A301E989A7A00B643C4 /* SirenDelegate.swift in Sources */,
|
||||
8E9C238D1E7CDD31000ED3DA /* SirenUIAlertControllerExtension.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8E3A6C001D07CB6F00A8B7CF /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8E1635A91E6A0B9C0060CE27 /* SirenTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917D1A58B465001C121E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EE6C7431E6A0AA500DBE454 /* AppDelegate.swift in Sources */,
|
||||
8EE6C7441E6A0AA500DBE454 /* ViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
55EC364D1E6BB98A00726F13 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 55EC36461E6BB98A00726F13 /* Siren */;
|
||||
targetProxy = 55EC364C1E6BB98A00726F13 /* PBXContainerItemProxy */;
|
||||
};
|
||||
8E3A6C0A1D07CB6F00A8B7CF /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8EC391801A58B465001C121E /* SirenExample */;
|
||||
targetProxy = 8E3A6C091D07CB6F00A8B7CF /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
8EBDF8211E6A0C41006C87B4 /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8EBDF8221E6A0C41006C87B4 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF8231E6A0C41006C87B4 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8EBDF8241E6A0C41006C87B4 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
55EC36501E6BB98A00726F13 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = Siren/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.sabintsev.Siren;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
55EC36511E6BB98A00726F13 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = Siren/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.sabintsev.Siren;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8E3A6C0B1D07CB6F00A8B7CF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = SirenExampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.sabintsev.SirenTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SirenExample.app/SirenExample";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8E3A6C0C1D07CB6F00A8B7CF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = SirenExampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.sabintsev.SirenTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SirenExample.app/SirenExample";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8EC3919E1A58B466001C121E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EC3919F1A58B466001C121E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8EC391A11A58B466001C121E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/SirenExample/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.apple.itunesconnect.mobile;
|
||||
PRODUCT_NAME = SirenExample;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EC391A21A58B466001C121E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/SirenExample/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.apple.itunesconnect.mobile;
|
||||
PRODUCT_NAME = SirenExample;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
55EC36521E6BB98A00726F13 /* Build configuration list for PBXNativeTarget "Siren" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
55EC36501E6BB98A00726F13 /* Debug */,
|
||||
55EC36511E6BB98A00726F13 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8E3A6C0D1D07CB6F00A8B7CF /* Build configuration list for PBXNativeTarget "SirenExampleTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8E3A6C0B1D07CB6F00A8B7CF /* Debug */,
|
||||
8E3A6C0C1D07CB6F00A8B7CF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "SirenExample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC3919E1A58B466001C121E /* Debug */,
|
||||
8EC3919F1A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "SirenExample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC391A11A58B466001C121E /* Debug */,
|
||||
8EC391A21A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 8EC391791A58B465001C121E /* Project object */;
|
||||
}
|
||||
Generated
Regular → Executable
+1
-1
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Sample App.xcodeproj">
|
||||
location = "self:/Users/Arthur/Documents/oss/siren/Sample App/SirenExample.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "55EC36461E6BB98A00726F13"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "55EC36461E6BB98A00726F13"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "55EC36461E6BB98A00726F13"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EC391801A58B465001C121E"
|
||||
BuildableName = "SirenExample.app"
|
||||
BlueprintName = "SirenExample"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8E3A6C031D07CB6F00A8B7CF"
|
||||
BuildableName = "SirenExampleTests.xctest"
|
||||
BlueprintName = "SirenExampleTests"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EC391801A58B465001C121E"
|
||||
BuildableName = "SirenExample.app"
|
||||
BlueprintName = "SirenExample"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EC391801A58B465001C121E"
|
||||
BuildableName = "SirenExample.app"
|
||||
BlueprintName = "SirenExample"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EC391801A58B465001C121E"
|
||||
BuildableName = "SirenExample.app"
|
||||
BlueprintName = "SirenExample"
|
||||
ReferencedContainer = "container:SirenExample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Siren
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
setupSiren()
|
||||
|
||||
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 - 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/Appendices/AppStoreTerritories.html
|
||||
// siren.countryCode = ""
|
||||
|
||||
// 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
|
||||
|
||||
// Required
|
||||
siren.checkVersion(checkType: .immediately)
|
||||
}
|
||||
|
||||
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: .immediately)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate: SirenDelegate
|
||||
{
|
||||
func sirenDidShowUpdateDialog(alertType: Siren.AlertType) {
|
||||
print(#function, alertType)
|
||||
}
|
||||
|
||||
func sirenUserDidCancel() {
|
||||
print(#function)
|
||||
}
|
||||
|
||||
func sirenUserDidSkipVersion() {
|
||||
print(#function)
|
||||
}
|
||||
|
||||
func sirenUserDidLaunchAppStore() {
|
||||
print(#function)
|
||||
}
|
||||
|
||||
func sirenDidFailVersionCheck(error: NSError) {
|
||||
print(#function, error)
|
||||
}
|
||||
|
||||
func sirenLatestVersionInstalled() {
|
||||
print(#function, "Latest version of app is installed")
|
||||
}
|
||||
|
||||
// This delegate method is only hit when alertType is initialized to .none
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
print(#function, "\(message)")
|
||||
}
|
||||
}
|
||||
Regular → Executable
+6
-8
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11191" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11156"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
@@ -13,19 +13,17 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sample App" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
||||
Regular → Executable
+3
-3
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="Sample_App" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
||||
Regular → Executable
Regular → Executable
+4
-2
@@ -3,11 +3,11 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<string>en_US</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.sabintsev.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -33,6 +33,8 @@
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Regular → Executable
+1
-2
@@ -19,7 +19,6 @@ class ViewController: UIViewController {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,804 @@
|
||||
//
|
||||
// SirenTests.swift
|
||||
// SirenTests
|
||||
//
|
||||
// Created by Arthur Sabintsev on 6/7/16.
|
||||
// Copyright © 2016 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import Siren
|
||||
|
||||
class SirenTests: XCTestCase {
|
||||
|
||||
let siren = Siren.shared
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Updates
|
||||
|
||||
extension SirenTests {
|
||||
|
||||
func testSingleDigitVersionUpdate() {
|
||||
siren.testSetCurrentInstalledVersion(version: "1")
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
}
|
||||
|
||||
func testDoubleDigitVersionUpdate() {
|
||||
siren.testSetCurrentInstalledVersion(version: "1.0")
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
}
|
||||
|
||||
func testTripleDigitVersionUpdate() {
|
||||
siren.testSetCurrentInstalledVersion(version: "1.0.0")
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
}
|
||||
|
||||
func testQuadrupleDigitVersionUpdate() {
|
||||
siren.testSetCurrentInstalledVersion(version: "1.0.0")
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "2.0.0.0")
|
||||
XCTAssertTrue(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
|
||||
siren.testSetAppStoreVersion(version: "0.0.0.9")
|
||||
XCTAssertFalse(siren.testIsAppStoreVersionNewer())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Localization
|
||||
|
||||
extension SirenTests {
|
||||
|
||||
func testArabicLocalization() {
|
||||
let language: Siren.LanguageType = .Arabic
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "التجديد متوفر")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "المرة التالية")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "تخطى عن هذه النسخة")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "تجديد")
|
||||
}
|
||||
|
||||
func testArmenianLocalization() {
|
||||
let language: Siren.LanguageType = .Armenian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Թարմացումը հասանելի Է")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Հաջորդ անգամ")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Բաց թողնել այս տարբերակը")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Թարմացնել")
|
||||
}
|
||||
|
||||
func testBasqueLocalization() {
|
||||
let language: Siren.LanguageType = .Basque
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Eguneratzea erabilgarri")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Hurrengo batean")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Bertsio honetatik jauzi egin")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Eguneratu")
|
||||
}
|
||||
|
||||
func testChineseSimplifiedLocalization() {
|
||||
let language: Siren.LanguageType = .ChineseSimplified
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "更新可用")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "下一次")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "跳过此版本")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "更新")
|
||||
}
|
||||
|
||||
func testChineseTraditionalLocalization() {
|
||||
let language: Siren.LanguageType = .ChineseTraditional
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "有更新可用")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "下次")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "跳過此版本")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "更新")
|
||||
}
|
||||
|
||||
func testCroatianLocalization() {
|
||||
let language: Siren.LanguageType = .Croatian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Nova ažuriranje je stigla")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Sljedeći put")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Preskoči ovu verziju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Ažuriraj")
|
||||
}
|
||||
|
||||
func testCzechLocalization() {
|
||||
let language: Siren.LanguageType = .Czech
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Aktualizace dostupná")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Příště")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Přeskočit tuto verzi")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Aktualizovat")
|
||||
}
|
||||
|
||||
func testDanishLocalization() {
|
||||
let language: Siren.LanguageType = .Danish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Tilgængelig opdatering")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Næste gang")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Spring denne version over")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Opdater")
|
||||
}
|
||||
|
||||
func testDutchLocalization() {
|
||||
let language: Siren.LanguageType = .Dutch
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Update Beschikbaar")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Volgende keer")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Sla deze versie over")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Updaten")
|
||||
}
|
||||
|
||||
func testEstonianLocalization() {
|
||||
let language: Siren.LanguageType = .Estonian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Uuendus saadaval")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Järgmisel korral")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Jäta see version vahele")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Uuenda")
|
||||
}
|
||||
|
||||
func testFinnishLocalization() {
|
||||
let language: Siren.LanguageType = .Finnish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Päivitys saatavilla")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Ensi kerralla")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Jätä tämä versio väliin")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Päivitys")
|
||||
}
|
||||
|
||||
func testFrenchLocalization() {
|
||||
let language: Siren.LanguageType = .French
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Mise à jour disponible")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "La prochaine fois")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Sauter cette version")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Mettre à jour")
|
||||
}
|
||||
|
||||
func testGermanLocalization() {
|
||||
let language: Siren.LanguageType = .German
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Update erhältlich")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Später")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Diese Version überspringen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Update")
|
||||
}
|
||||
|
||||
func testGreekLocalization() {
|
||||
let language: Siren.LanguageType = .Greek
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Διαθέσιμη Ενημέρωση")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Άλλη φορά")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Αγνόησε αυτήν την έκδοση")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Αναβάθμιση")
|
||||
}
|
||||
|
||||
func testHebrewLocalization() {
|
||||
let language: Siren.LanguageType = .Hebrew
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "עדכון זמין")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "בפעם הבאה")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "דלג על גרסה זו")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "עדכן")
|
||||
}
|
||||
|
||||
func testHungarianLocalization() {
|
||||
let language: Siren.LanguageType = .Hungarian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Új frissítés érhető el")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Később")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Ennél a verziónál ne figyelmeztessen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Frissítés")
|
||||
}
|
||||
|
||||
func testIndonesianLocalization() {
|
||||
let language: Siren.LanguageType = .Indonesian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Pembaruan Tersedia")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Lain kali")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Lewati versi ini")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Perbarui")
|
||||
}
|
||||
|
||||
func testItalianLocalization() {
|
||||
let language: Siren.LanguageType = .Italian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Aggiornamento disponibile")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "La prossima volta")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Salta questa versione")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Aggiorna")
|
||||
}
|
||||
|
||||
func testJapaneseLocalization() {
|
||||
let language: Siren.LanguageType = .Japanese
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "更新が利用可能")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "次回")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "このバージョンをスキップ")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "更新")
|
||||
}
|
||||
|
||||
func testKoreanLocalization() {
|
||||
let language: Siren.LanguageType = .Korean
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "업데이트 가능")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "다음에")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "이 버전 건너뜀")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "업데이트")
|
||||
}
|
||||
|
||||
func testLatvianLocalization() {
|
||||
let language: Siren.LanguageType = .Latvian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Atjauninājums pieejams")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Nākamreiz")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Izlaist šo versiju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Atjaunināt")
|
||||
}
|
||||
|
||||
func testLithuanianLocalization() {
|
||||
let language: Siren.LanguageType = .Lithuanian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Atnaujinimas")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Kitą kartą")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Praleisti šią versiją")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Atnaujinti")
|
||||
}
|
||||
|
||||
func testMalayLocalization() {
|
||||
let language: Siren.LanguageType = .Malay
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Versi Terkini")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Lain kali")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Langkau versi ini")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Muat turun")
|
||||
}
|
||||
|
||||
func testNorwegianLocalization() {
|
||||
let language: Siren.LanguageType = .Norwegian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Oppdatering tilgjengelig")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Neste gang")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Hopp over denne versjonen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Oppdater")
|
||||
}
|
||||
|
||||
func testPersianLocalization() {
|
||||
let language: Siren.LanguageType = .Persian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "دفعه بعد")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPersianAfghanistanLocalization() {
|
||||
let language: Siren.LanguageType = .PersianAfghanistan
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "دگر بار")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPersianIranLocalization() {
|
||||
let language: Siren.LanguageType = .PersianIran
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "دفعه بعد")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPolishLocalization() {
|
||||
let language: Siren.LanguageType = .Polish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Aktualizacja dostępna")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Następnym razem")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Pomiń wersję")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Zaktualizuj")
|
||||
}
|
||||
|
||||
func testPortugueseBrazilLocalization() {
|
||||
let language: Siren.LanguageType = .PortugueseBrazil
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Atualização disponível")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Ignorar esta versão")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Atualizar")
|
||||
}
|
||||
|
||||
func testPortuguesePortugalLocalization() {
|
||||
let language: Siren.LanguageType = .PortuguesePortugal
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Nova actualização disponível")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Ignorar esta versão")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Actualizar")
|
||||
}
|
||||
|
||||
func testRussianLocalization() {
|
||||
let language: Siren.LanguageType = .Russian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Доступно обновление")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "В следующий раз")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Пропустить эту версию")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Обновить")
|
||||
}
|
||||
|
||||
func testSerbianCyrillicLocalization() {
|
||||
let language: Siren.LanguageType = .SerbianCyrillic
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Ажурирање доступно")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Следећи пут")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Прескочи ову верзију")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Ажурирај")
|
||||
}
|
||||
|
||||
func testSerbianLatinLocalization() {
|
||||
let language: Siren.LanguageType = .SerbianLatin
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Ažuriranje dostupno")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Sledeći put")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Preskoči ovu verziju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Ažuriraj")
|
||||
}
|
||||
|
||||
func testSlovenianLocalization() {
|
||||
let language: Siren.LanguageType = .Slovenian
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Posodobitev aplikacije")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Naslednjič")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Ne želim")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Namesti")
|
||||
}
|
||||
|
||||
func testSpanishLocalization() {
|
||||
let language: Siren.LanguageType = .Spanish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Actualización disponible")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "La próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Saltar esta versión")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Actualizar")
|
||||
}
|
||||
|
||||
func testSwedishLocalization() {
|
||||
let language: Siren.LanguageType = .Swedish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Tillgänglig uppdatering")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Nästa gång")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Hoppa över den här versionen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Uppdatera")
|
||||
}
|
||||
|
||||
func testThaiLocalization() {
|
||||
let language: Siren.LanguageType = .Thai
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "มีการอัพเดท")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "ไว้คราวหน้า")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "ข้ามเวอร์ชั่นนี้")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "อัพเดท")
|
||||
}
|
||||
|
||||
func testTurkishLocalization() {
|
||||
let language: Siren.LanguageType = .Turkish
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Güncelleme Mevcut")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Daha sonra")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Boşver")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Güncelle")
|
||||
}
|
||||
|
||||
func testVietnameseLocalization() {
|
||||
let language: Siren.LanguageType = .Vietnamese
|
||||
siren.forceLanguageLocalization = language
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update Available", forceLanguageLocalization: language), "Cập nhật mới")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Next time", forceLanguageLocalization: language), "Lần tới")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Skip this version", forceLanguageLocalization: language), "Bỏ qua phiên bản này")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle().testLocalizedString(stringKey: "Update", forceLanguageLocalization: language), "Cập nhật")
|
||||
}
|
||||
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Regular → Executable
Regular → Executable
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Μια νέα έκδοση του %@ είναι διαθέσιμη. Παρακαλώ κάντε αναβάθμιση στο %@ τώρα.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Διαθέσιμη Ενημέρωση";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Άλλη φορά";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Αγνόησε αυτήν την έκδοση";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Αναβάθμιση";
|
||||
Regular → Executable
Regular → Executable
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "On ilmunud uus %@ versioon. Palun uuendage %@ versioonini.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Uuendus saadaval";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Järgmisel korral";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Jäta see version vahele";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Uuenda";
|
||||
Regular → Executable
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "%@ on päivittynyt. Ole hyvä ja päivitä versioon %@ nyt.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Päivitys saatavilla";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Ensi kerralla";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Jätä tämä versio väliin";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Päivitys";
|
||||
Regular → Executable
Regular → Executable
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Nova verzia %@ je stigla. Ažuriraj na verziju %@ sada.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Nova ažuriranje je stigla";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Sljedeći put";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Preskoči ovu verziju";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Ažuriraj";
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Új verziója érhető el a %@ alkalmazásnak. Kérjük frissítsen a %@ verzióra.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Új frissítés érhető el";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Később";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Ennél a verziónál ne figyelmeztessen";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Frissítés";
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Versi baru %@ tersedia. Perbarui ke versi %@ sekarang.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Pembaruan Tersedia";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Lain kali";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Lewati versi ini";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Perbarui";
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
+14
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Atsirado nauja %@ versija. Prašome atsinaujinti iki %@ versijos.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Atnaujinimas";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Kitą kartą";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Praleisti šią versiją";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Atnaujinti";
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Pieejama jauna %@ versija. Lūdzam atjaunot versiju %@.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Atjauninājums pieejams";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Nākamreiz";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Izlaist šo versiju";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Atjaunināt";
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Versi terkini untuk %@ telah ada. Sila muat turun versi %@ sekarang.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Versi Terkini";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Lain kali";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Langkau versi ini";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Muat turun";
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "En ny versjon av %@ er tilgjengelig. Vennligst oppdater til versjon %@ nå.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Oppdatering tilgjengelig";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Neste gang";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Hopp over denne versjonen";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Oppdater";
|
||||
Regular → Executable
BIN
Binary file not shown.
Regular → Executable
+15
@@ -0,0 +1,15 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now."="Uma nova versão do %@ está disponível. Por favor atualize para a versão %@ agora.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available"="Atualização disponível";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time"="Próxima vez";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version"="Ignorar esta versão";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update"="Atualizar";
|
||||
|
||||
Regular → Executable
Binary file not shown.
Binary file not shown.
Regular → Executable
BIN
Binary file not shown.
Regular → Executable
+14
@@ -0,0 +1,14 @@
|
||||
/* Update alert message: A new version of {APP NAME} is available. Please update to version {NEW VERSION} now.*/
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Đã có phiên bản mới của %@. Xin vui lòng cập nhật lên phiên bản %@.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Cập nhật mới";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Lần tới";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Bỏ qua phiên bản này";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Cập nhật";
|
||||
Regular → Executable
Regular → Executable
@@ -0,0 +1,643 @@
|
||||
//
|
||||
// Siren.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
// MARK: - Siren
|
||||
|
||||
/// The Siren Class. A singleton that is initialized using the shared() method.
|
||||
public final class Siren: NSObject {
|
||||
|
||||
/// 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:
|
||||
///
|
||||
/// When a user views or interacts with the alert
|
||||
/// - sirenDidShowUpdateDialog(alertType: AlertType)
|
||||
/// - sirenUserDidLaunchAppStore()
|
||||
/// - sirenUserDidSkipVersion()
|
||||
/// - sirenUserDidCancel()
|
||||
///
|
||||
/// When a new version has been detected, and you would like to present a localized message in a custom UI. use this delegate method:
|
||||
/// - sirenDidDetectNewVersionWithoutAlert(message: String)
|
||||
public weak var delegate: SirenDelegate?
|
||||
|
||||
/// The debug flag, which is disabled by default.
|
||||
/// When enabled, a stream of println() 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: String = Bundle.main.bestMatchingAppName()
|
||||
|
||||
/// 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?
|
||||
|
||||
/// Overrides the tint color for UIAlertController.
|
||||
public var alertControllerTintColor: UIColor?
|
||||
|
||||
/// 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 current version of your app that is available for download on the App Store
|
||||
public internal(set) var currentAppStoreVersion: String?
|
||||
|
||||
internal var updaterWindow: UIWindow?
|
||||
fileprivate var appID: Int?
|
||||
fileprivate var lastVersionCheckPerformedOnDate: Date?
|
||||
fileprivate lazy var alertViewIsVisible: Bool = false
|
||||
|
||||
/// The App's Singleton
|
||||
public static let shared = Siren()
|
||||
|
||||
@available(*, deprecated: 1.2.0, unavailable, renamed: "shared")
|
||||
public static let sharedInstance = Siren()
|
||||
|
||||
override init() {
|
||||
lastVersionCheckPerformedOnDate = UserDefaults.standard.object(forKey: SirenDefaults.StoredVersionCheckDate.rawValue) as? Date
|
||||
}
|
||||
|
||||
/// 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) {
|
||||
guard let _ = Bundle.bundleID() else {
|
||||
printMessage(message: "Please make sure that you have set a `Bundle Identifier` in your project.")
|
||||
return
|
||||
}
|
||||
|
||||
if checkType == .immediately {
|
||||
performVersionCheck()
|
||||
} else {
|
||||
guard let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate else {
|
||||
performVersionCheck()
|
||||
return
|
||||
}
|
||||
|
||||
if Date.days(since: lastVersionCheckPerformedOnDate) >= checkType.rawValue {
|
||||
performVersionCheck()
|
||||
} else {
|
||||
postError(.recentlyCheckedAlready, underlyingError: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers (Networking)
|
||||
|
||||
private extension Siren {
|
||||
|
||||
func performVersionCheck() {
|
||||
do {
|
||||
let url = try iTunesURLFromString()
|
||||
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringCacheData, timeoutInterval: 30)
|
||||
URLSession.shared.dataTask(with: request, completionHandler: { [unowned self] (data, response, error) in
|
||||
self.processResults(withData: data, response: response, error: error)
|
||||
}).resume()
|
||||
} catch let error as NSError {
|
||||
postError(.malformedURL, underlyingError: error)
|
||||
}
|
||||
}
|
||||
|
||||
func processResults(withData data: Data?, response: URLResponse?, error: Error?) {
|
||||
if let error = error {
|
||||
postError(.appStoreDataRetrievalFailure, underlyingError: error)
|
||||
} else {
|
||||
guard let data = data else {
|
||||
postError(.appStoreDataRetrievalFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
do {
|
||||
let jsonData = try JSONSerialization.jsonObject(with: data, options: [])
|
||||
guard let appData = jsonData as? [String: Any],
|
||||
isUpdateCompatibleWithDeviceOS(appData: appData) else {
|
||||
postError(.appStoreJSONParsingFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async { [unowned self] in
|
||||
// Print iTunesLookup results from appData
|
||||
self.printMessage(message: "JSON results: \(appData)")
|
||||
|
||||
// Process Results (e.g., extract current version that is available on the AppStore)
|
||||
self.processVersionCheck(with: appData)
|
||||
}
|
||||
|
||||
} catch let error as NSError {
|
||||
postError(.appStoreDataRetrievalFailure, underlyingError: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func processVersionCheck(with payload: [String: Any]) {
|
||||
storeVersionCheckDate() // Store version comparison date
|
||||
|
||||
guard let results = payload[JSONKeys.results] as? [[String: Any]] else {
|
||||
postError(.appStoreVersionNumberFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
/// Condition satisfied when app not in App Store
|
||||
guard !results.isEmpty else {
|
||||
postError(.appStoreDataRetrievalFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
guard let info = results.first else {
|
||||
postError(.appStoreDataRetrievalFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
guard let appID = info[JSONKeys.appID] as? Int else {
|
||||
postError(.appStoreAppIDFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
self.appID = appID
|
||||
|
||||
guard let currentAppStoreVersion = info[JSONKeys.version] as? String else {
|
||||
postError(.appStoreVersionArrayFailure, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
self.currentAppStoreVersion = currentAppStoreVersion
|
||||
|
||||
guard isAppStoreVersionNewer() else {
|
||||
delegate?.sirenLatestVersionInstalled()
|
||||
postError(.noUpdateAvailable, underlyingError: nil)
|
||||
return
|
||||
}
|
||||
|
||||
guard let currentVersionReleaseDate = info[JSONKeys.currentVersionReleaseDate] as? String,
|
||||
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: 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.malformedURL
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers (Alert)
|
||||
|
||||
private extension Siren {
|
||||
func showAlertIfCurrentAppStoreVersionNotSkipped() {
|
||||
alertType = setAlertType()
|
||||
|
||||
guard let previouslySkippedVersion = UserDefaults.standard.object(forKey: SirenDefaults.StoredSkippedVersion.rawValue) as? String else {
|
||||
showAlert()
|
||||
return
|
||||
}
|
||||
|
||||
if let currentAppStoreVersion = currentAppStoreVersion, currentAppStoreVersion != previouslySkippedVersion {
|
||||
showAlert()
|
||||
}
|
||||
}
|
||||
|
||||
func showAlert() {
|
||||
let updateAvailableMessage = Bundle().localizedString(stringKey: "Update Available", forceLanguageLocalization: forceLanguageLocalization)
|
||||
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:
|
||||
delegate?.sirenDidDetectNewVersionWithoutAlert(message: newVersionMessage)
|
||||
}
|
||||
|
||||
if alertType != .none && !alertViewIsVisible {
|
||||
alertController.show()
|
||||
alertViewIsVisible = true
|
||||
delegate?.sirenDidShowUpdateDialog(alertType: alertType)
|
||||
}
|
||||
}
|
||||
|
||||
func updateAlertAction() -> UIAlertAction {
|
||||
let title = localizedUpdateButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .default) { [unowned self] _ in
|
||||
self.hideWindow()
|
||||
self.launchAppStore()
|
||||
self.delegate?.sirenUserDidLaunchAppStore()
|
||||
self.alertViewIsVisible = false
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func nextTimeAlertAction() -> UIAlertAction {
|
||||
let title = localizedNextTimeButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .default) { [unowned self] _ in
|
||||
self.hideWindow()
|
||||
self.delegate?.sirenUserDidCancel()
|
||||
self.alertViewIsVisible = false
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func skipAlertAction() -> UIAlertAction {
|
||||
let title = localizedSkipButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .default) { [unowned self] _ in
|
||||
|
||||
if let currentAppStoreVersion = self.currentAppStoreVersion {
|
||||
UserDefaults.standard.set(currentAppStoreVersion, forKey: SirenDefaults.StoredSkippedVersion.rawValue)
|
||||
UserDefaults.standard.synchronize()
|
||||
}
|
||||
|
||||
self.hideWindow()
|
||||
self.delegate?.sirenUserDidSkipVersion()
|
||||
self.alertViewIsVisible = false
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func setAlertType() -> Siren.AlertType {
|
||||
guard let currentInstalledVersion = currentInstalledVersion,
|
||||
let currentAppStoreVersion = currentAppStoreVersion else {
|
||||
return .option
|
||||
}
|
||||
|
||||
let oldVersion = (currentInstalledVersion).characters.split {$0 == "."}.map { String($0) }.map {Int($0) ?? 0}
|
||||
let newVersion = (currentAppStoreVersion).characters.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
|
||||
}
|
||||
|
||||
if newVersionFirst > oldVersionFirst { // A.b.c.d
|
||||
alertType = majorUpdateAlertType
|
||||
} else if newVersion.count > 1 && (oldVersion.count <= 1 || newVersion[1] > oldVersion[1]) { // a.B.c.d
|
||||
alertType = minorUpdateAlertType
|
||||
} else if newVersion.count > 2 && (oldVersion.count <= 2 || newVersion[2] > oldVersion[2]) { // a.b.C.d
|
||||
alertType = patchUpdateAlertType
|
||||
} else if newVersion.count > 3 && (oldVersion.count <= 3 || newVersion[3] > oldVersion[3]) { // a.b.c.D
|
||||
alertType = revisionUpdateAlertType
|
||||
}
|
||||
|
||||
return alertType
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers (Localization)
|
||||
|
||||
private extension Siren {
|
||||
func localizedNewVersionMessage() -> String {
|
||||
let newVersionMessageToLocalize = "A new version of %@ is available. Please update to version %@ now."
|
||||
let newVersionMessage = Bundle().localizedString(stringKey: newVersionMessageToLocalize, forceLanguageLocalization: forceLanguageLocalization)
|
||||
|
||||
guard let currentAppStoreVersion = currentAppStoreVersion else {
|
||||
return String(format: newVersionMessage, appName, "Unknown")
|
||||
}
|
||||
|
||||
return String(format: newVersionMessage, appName, currentAppStoreVersion)
|
||||
}
|
||||
|
||||
func localizedUpdateButtonTitle() -> String {
|
||||
return Bundle().localizedString(stringKey: "Update", forceLanguageLocalization: forceLanguageLocalization)
|
||||
}
|
||||
|
||||
func localizedNextTimeButtonTitle() -> String {
|
||||
return Bundle().localizedString(stringKey: "Next time", forceLanguageLocalization: forceLanguageLocalization)
|
||||
}
|
||||
|
||||
func localizedSkipButtonTitle() -> String {
|
||||
return Bundle().localizedString(stringKey: "Skip this version", forceLanguageLocalization: forceLanguageLocalization)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers (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
|
||||
}
|
||||
|
||||
fileprivate func storeVersionCheckDate() {
|
||||
lastVersionCheckPerformedOnDate = Date()
|
||||
if let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate {
|
||||
UserDefaults.standard.set(lastVersionCheckPerformedOnDate, forKey: SirenDefaults.StoredVersionCheckDate.rawValue)
|
||||
UserDefaults.standard.synchronize()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers (Misc.)
|
||||
|
||||
private extension Siren {
|
||||
func isUpdateCompatibleWithDeviceOS(appData: [String: Any]) -> Bool {
|
||||
guard let results = appData[JSONKeys.results] as? [[String: Any]],
|
||||
let info = results.first,
|
||||
let requiredOSVersion = info[JSONKeys.minimumOSVersion] as? String else {
|
||||
postError(.appStoreOSVersionNumberFailure, underlyingError: nil)
|
||||
return false
|
||||
}
|
||||
|
||||
let systemVersion = UIDevice.current.systemVersion
|
||||
|
||||
guard systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedDescending ||
|
||||
systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedSame else {
|
||||
postError(.appStoreOSVersionUnsupported, underlyingError: nil)
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func hideWindow() {
|
||||
if let updaterWindow = updaterWindow {
|
||||
updaterWindow.isHidden = true
|
||||
self.updaterWindow = nil
|
||||
}
|
||||
}
|
||||
|
||||
func launchAppStore() {
|
||||
guard let appID = appID,
|
||||
let iTunesURL = URL(string: "https://itunes.apple.com/app/id\(appID)") else {
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.openURL(iTunesURL)
|
||||
}
|
||||
}
|
||||
|
||||
func printMessage(message: String) {
|
||||
if debugEnabled {
|
||||
print("[Siren] \(message)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Enumerated Types (Public)
|
||||
|
||||
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 {
|
||||
case Arabic = "ar"
|
||||
case Armenian = "hy"
|
||||
case Basque = "eu"
|
||||
case ChineseSimplified = "zh-Hans"
|
||||
case ChineseTraditional = "zh-Hant"
|
||||
case Croatian = "hr"
|
||||
case Czech = "cs"
|
||||
case Danish = "da"
|
||||
case Dutch = "nl"
|
||||
case English = "en"
|
||||
case Estonian = "et"
|
||||
case Finnish = "fi"
|
||||
case French = "fr"
|
||||
case German = "de"
|
||||
case Greek = "el"
|
||||
case Hebrew = "he"
|
||||
case Hungarian = "hu"
|
||||
case Indonesian = "id"
|
||||
case Italian = "it"
|
||||
case Japanese = "ja"
|
||||
case Korean = "ko"
|
||||
case Latvian = "lv"
|
||||
case Lithuanian = "lt"
|
||||
case Malay = "ms"
|
||||
case Norwegian = "nb-NO"
|
||||
case Persian = "fa"
|
||||
case PersianAfghanistan = "fa-AF"
|
||||
case PersianIran = "fa-IR"
|
||||
case Polish = "pl"
|
||||
case PortugueseBrazil = "pt"
|
||||
case PortuguesePortugal = "pt-PT"
|
||||
case Russian = "ru"
|
||||
case SerbianCyrillic = "sr-Cyrl"
|
||||
case SerbianLatin = "sr-Latn"
|
||||
case Slovenian = "sl"
|
||||
case Spanish = "es"
|
||||
case Swedish = "sv"
|
||||
case Thai = "th"
|
||||
case Turkish = "tr"
|
||||
case Vietnamese = "vi"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Enumerated Types (Private)
|
||||
|
||||
private extension Siren {
|
||||
/// Siren-specific Error Codes
|
||||
enum ErrorCode: Int {
|
||||
case malformedURL = 1000
|
||||
case recentlyCheckedAlready
|
||||
case noUpdateAvailable
|
||||
case appStoreDataRetrievalFailure
|
||||
case appStoreJSONParsingFailure
|
||||
case appStoreOSVersionNumberFailure
|
||||
case appStoreOSVersionUnsupported
|
||||
case appStoreVersionNumberFailure
|
||||
case appStoreVersionArrayFailure
|
||||
case appStoreAppIDFailure
|
||||
case appStoreReleaseDateFailure
|
||||
}
|
||||
|
||||
/// Siren-specific Throwable Errors
|
||||
enum SirenError: Error {
|
||||
case malformedURL
|
||||
case missingBundleIdOrAppId
|
||||
}
|
||||
|
||||
/// Siren-specific UserDefaults Keys
|
||||
enum SirenDefaults: String {
|
||||
/// Key that stores the timestamp of the last version check in UserDefaults
|
||||
case StoredVersionCheckDate
|
||||
|
||||
/// Key that stores the version that a user decided to skip in UserDefaults.
|
||||
case StoredSkippedVersion
|
||||
}
|
||||
|
||||
struct JSONKeys {
|
||||
static let appID = "trackId"
|
||||
static let currentVersionReleaseDate = "currentVersionReleaseDate"
|
||||
static let minimumOSVersion = "minimumOsVersion"
|
||||
static let results = "results"
|
||||
static let version = "version"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Error Handling
|
||||
|
||||
private extension Siren {
|
||||
func postError(_ code: ErrorCode, underlyingError: Error?) {
|
||||
let description: String
|
||||
|
||||
switch code {
|
||||
case .malformedURL:
|
||||
description = "The iTunes URL is malformed. Please leave an issue on http://github.com/ArtSabintsev/Siren with as many details as possible."
|
||||
case .recentlyCheckedAlready:
|
||||
description = "Not checking the version, because it already checked recently."
|
||||
case .noUpdateAvailable:
|
||||
description = "No new update available."
|
||||
case .appStoreDataRetrievalFailure:
|
||||
description = "Error retrieving App Store data as an error was returned."
|
||||
case .appStoreJSONParsingFailure:
|
||||
description = "Error parsing App Store JSON data."
|
||||
case .appStoreOSVersionNumberFailure:
|
||||
description = "Error retrieving iOS version number as there was no data returned."
|
||||
case .appStoreOSVersionUnsupported:
|
||||
description = "The version of iOS on the device is lower than that of the one required by the app verison update."
|
||||
case .appStoreVersionNumberFailure:
|
||||
description = "Error retrieving App Store version number as there was no data returned."
|
||||
case .appStoreVersionArrayFailure:
|
||||
description = "Error retrieving App Store verson number as the JSON does not contain a 'version' key."
|
||||
case .appStoreAppIDFailure:
|
||||
description = "Error retrieving trackId as the JSON does not contain a 'trackId' key."
|
||||
case .appStoreReleaseDateFailure:
|
||||
description = "Error retrieving trackId as the JSON does not contain a 'currentVersionReleaseDate' key."
|
||||
}
|
||||
|
||||
var userInfo: [String: Any] = [NSLocalizedDescriptionKey: description]
|
||||
|
||||
if let underlyingError = underlyingError {
|
||||
userInfo[NSUnderlyingErrorKey] = underlyingError
|
||||
}
|
||||
|
||||
let error = NSError(domain: SirenErrorDomain, code: code.rawValue, userInfo: userInfo)
|
||||
|
||||
delegate?.sirenDidFailVersionCheck(error: error)
|
||||
|
||||
printMessage(message: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
internal extension Bundle {
|
||||
class func bundleID() -> String? {
|
||||
return Bundle.main.bundleIdentifier
|
||||
}
|
||||
|
||||
func sirenBundlePath() -> String {
|
||||
return Bundle(for: Siren.self).path(forResource: "Siren", ofType: "bundle") as String!
|
||||
}
|
||||
|
||||
func sirenForcedBundlePath(forceLanguageLocalization: Siren.LanguageType) -> String {
|
||||
let path = sirenBundlePath()
|
||||
let name = forceLanguageLocalization.rawValue
|
||||
return Bundle(path: path)!.path(forResource: name, ofType: "lproj")!
|
||||
}
|
||||
|
||||
func localizedString(stringKey: String, forceLanguageLocalization: Siren.LanguageType?) -> String {
|
||||
var path: String
|
||||
let table = "SirenLocalizable"
|
||||
if let forceLanguageLocalization = forceLanguageLocalization {
|
||||
path = sirenForcedBundlePath(forceLanguageLocalization: forceLanguageLocalization)
|
||||
} else {
|
||||
path = sirenBundlePath()
|
||||
}
|
||||
|
||||
return Bundle(path: path)!.localizedString(forKey: stringKey, value: stringKey, table: table)
|
||||
}
|
||||
|
||||
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(stringKey: String, forceLanguageLocalization: Siren.LanguageType?) -> String {
|
||||
return Bundle().localizedString(stringKey: stringKey, forceLanguageLocalization: forceLanguageLocalization)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// SirenDateExtension.swift
|
||||
// SirenExample
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/21/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
internal extension 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
|
||||
}
|
||||
|
||||
static func days(since dateString: String) -> Int? {
|
||||
let dateformatter = DateFormatter()
|
||||
dateformatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'"
|
||||
|
||||
guard let releaseDate = dateformatter.date(from: dateString) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return days(since: releaseDate)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// SirenDelegate.swift
|
||||
// SirenExample
|
||||
//
|
||||
// Created by Arthur Sabintsev on 4/8/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - SirenDelegate Protocol
|
||||
|
||||
/// Delegate that handles all codepaths for Siren upon version check completion.
|
||||
public protocol SirenDelegate: class {
|
||||
/// User presented with update dialog.
|
||||
func sirenDidShowUpdateDialog(alertType: Siren.AlertType)
|
||||
|
||||
/// User did click on button that launched App Store.app.
|
||||
func sirenUserDidLaunchAppStore()
|
||||
|
||||
/// User did click on button that skips version update.
|
||||
func sirenUserDidSkipVersion()
|
||||
|
||||
/// User did click on button that cancels update dialog.
|
||||
func sirenUserDidCancel()
|
||||
|
||||
/// Siren failed to perform version check (may return system-level error).
|
||||
func sirenDidFailVersionCheck(error: NSError)
|
||||
|
||||
/// Siren performed version check and did not display alert.
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String)
|
||||
|
||||
/// Siren performed version check and latest version is installed.
|
||||
func sirenLatestVersionInstalled()
|
||||
}
|
||||
|
||||
// MARK: - SirenDelegate Protocol Extension
|
||||
|
||||
public extension SirenDelegate {
|
||||
|
||||
func sirenDidShowUpdateDialog(alertType: Siren.AlertType) {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenUserDidLaunchAppStore() {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenUserDidSkipVersion() {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenUserDidCancel() {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenDidFailVersionCheck(error: NSError) {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
func sirenLatestVersionInstalled() {
|
||||
assertionFailure("An attempt to reach \(#function) failed as it was called without being implemented.")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// SirenTestHelper.swift
|
||||
// SirenExample
|
||||
//
|
||||
// Created by Arthur Sabintsev on 4/8/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - Helpers (Testing Target)
|
||||
|
||||
extension Siren {
|
||||
func testSetCurrentInstalledVersion(version: String) {
|
||||
currentInstalledVersion = version
|
||||
}
|
||||
|
||||
func testSetAppStoreVersion(version: String) {
|
||||
currentAppStoreVersion = version
|
||||
}
|
||||
|
||||
func testIsAppStoreVersionNewer() -> Bool {
|
||||
return isAppStoreVersionNewer()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// SirenUIAlertControllerExtension.swift
|
||||
// SirenExample
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/17/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - UIAlertController Extension for Siren
|
||||
|
||||
internal extension UIAlertController {
|
||||
func show() {
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.rootViewController = SirenViewController()
|
||||
window.windowLevel = UIWindowLevelAlert + 1
|
||||
|
||||
Siren.shared.updaterWindow = window
|
||||
|
||||
window.makeKeyAndVisible()
|
||||
window.rootViewController!.present(self, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// SirenViewController.swift
|
||||
// SirenExample
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/17/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - UIViewController Extension for Siren
|
||||
|
||||
internal class SirenViewController: UIViewController {
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle { return UIApplication.shared.statusBarStyle }
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">Siren Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Siren"></a>
|
||||
<a name="//apple_ref/swift/Section/Siren" class="dashAnchor"></a>
|
||||
<a href="#/Siren">
|
||||
<h3 class="section-name">Siren</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C5Siren5Siren"></a>
|
||||
<a name="//apple_ref/swift/Class/Siren" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C5Siren5Siren">Siren</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Siren Class. A singleton that is initialized using the shared() method.</p>
|
||||
|
||||
<a href="Classes/Siren.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Siren</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,655 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Siren Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/Siren" class="dashAnchor"></a>
|
||||
<a title="Siren Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
Siren Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Siren</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Siren</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Siren Class. A singleton that is initialized using the shared() method.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren16SirenErrorDomainSS"></a>
|
||||
<a name="//apple_ref/swift/Property/SirenErrorDomain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren16SirenErrorDomainSS">SirenErrorDomain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The error domain for all errors created by Siren.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">SirenErrorDomain</span> <span class="o">=</span> <span class="s">"Siren Error Domain"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren8delegateXwGSqPS_13SirenDelegate__"></a>
|
||||
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren8delegateXwGSqPS_13SirenDelegate__">delegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The SirenDelegate variable, which should be set if you’d like to be notified:</p>
|
||||
|
||||
<p>When a user views or interacts with the alert
|
||||
- sirenDidShowUpdateDialog(alertType: AlertType)
|
||||
- sirenUserDidLaunchAppStore()
|
||||
- sirenUserDidSkipVersion()
|
||||
- sirenUserDidCancel()</p>
|
||||
|
||||
<p>When a new version has been detected, and you would like to present a localized message in a custom UI. use this delegate method:
|
||||
- sirenDidDetectNewVersionWithoutAlert(message: String)</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SirenDelegate.html">SirenDelegate</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren12debugEnabledSb"></a>
|
||||
<a name="//apple_ref/swift/Property/debugEnabled" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren12debugEnabledSb">debugEnabled</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The debug flag, which is disabled by default.
|
||||
When enabled, a stream of println() statements are logged to your console when a version check is performed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">debugEnabled</span> <span class="o">=</span> <span class="kc">false</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren9alertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/alertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren9alertTypeOS0_9AlertType">alertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the type of alert that should be shown.
|
||||
See the Siren.AlertType enum for full details.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">alertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20majorUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/majorUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20majorUpdateAlertTypeOS0_9AlertType">majorUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">majorUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20minorUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/minorUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20minorUpdateAlertTypeOS0_9AlertType">minorUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">minorUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20patchUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/patchUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20patchUpdateAlertTypeOS0_9AlertType">patchUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">patchUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren23revisionUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/revisionUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren23revisionUpdateAlertTypeOS0_9AlertType">revisionUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">revisionUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren7appNameSS"></a>
|
||||
<a name="//apple_ref/swift/Property/appName" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren7appNameSS">appName</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The name of your app.
|
||||
By default, it’s set to the name of the app that’s stored in your plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">appName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="kt">Bundle</span><span class="o">.</span><span class="n">main</span><span class="o">.</span><span class="nf">bestMatchingAppName</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren11countryCodeGSqSS_"></a>
|
||||
<a name="//apple_ref/swift/Property/countryCode" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren11countryCodeGSqSS_">countryCode</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">countryCode</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren25forceLanguageLocalizationGSqOS0_12LanguageType_"></a>
|
||||
<a name="//apple_ref/swift/Property/forceLanguageLocalization" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren25forceLanguageLocalizationGSqOS0_12LanguageType_">forceLanguageLocalization</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">forceLanguageLocalization</span><span class="p">:</span> <span class="kt">Siren</span><span class="o">.</span><span class="kt"><a href="../Classes/Siren/LanguageType.html">LanguageType</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren24alertControllerTintColorGSqCSo7UIColor_"></a>
|
||||
<a name="//apple_ref/swift/Property/alertControllerTintColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren24alertControllerTintColorGSqCSo7UIColor_">alertControllerTintColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Overrides the tint color for UIAlertController.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">alertControllerTintColor</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren50showAlertAfterCurrentVersionHasBeenReleasedForDaysSi"></a>
|
||||
<a name="//apple_ref/swift/Property/showAlertAfterCurrentVersionHasBeenReleasedForDays" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren50showAlertAfterCurrentVersionHasBeenReleasedForDaysSi">showAlertAfterCurrentVersionHasBeenReleasedForDays</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">showAlertAfterCurrentVersionHasBeenReleasedForDays</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren22currentAppStoreVersionGSqSS_"></a>
|
||||
<a name="//apple_ref/swift/Property/currentAppStoreVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren22currentAppStoreVersionGSqSS_">currentAppStoreVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The current version of your app that is available for download on the App Store</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">currentAppStoreVersion</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvC5Siren5Siren6sharedS0_"></a>
|
||||
<a name="//apple_ref/swift/Variable/shared" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvC5Siren5Siren6sharedS0_">shared</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The App’s Singleton</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">shared</span> <span class="o">=</span> <span class="kt">Siren</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC5Siren5Siren12checkVersionFT9checkTypeOS0_16VersionCheckType_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/checkVersion(checkType:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC5Siren5Siren12checkVersionFT9checkTypeOS0_16VersionCheckType_T_">checkVersion(checkType:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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 <code><a href="../Classes/Siren.html#/s:vC5Siren5Siren11countryCodeGSqSS_">countryCode</a></code> property before calling this method. Please refer to the countryCode property for more information.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">checkVersion</span><span class="p">(</span><span class="nv">checkType</span><span class="p">:</span> <span class="kt"><a href="../Classes/Siren/VersionCheckType.html">VersionCheckType</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>checkType</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The frequency in days in which you want a check to be performed. Please refer to the Siren.VersionCheckType enum for more details.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Enum/AlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren9AlertType">AlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the type of alert to present after a successful version check has been performed.</p>
|
||||
|
||||
<a href="../Classes/Siren/AlertType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">AlertType</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren16VersionCheckType"></a>
|
||||
<a name="//apple_ref/swift/Enum/VersionCheckType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren16VersionCheckType">VersionCheckType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the frequency in which the the version check is performed and the user is prompted to update the app.</p>
|
||||
|
||||
<a href="../Classes/Siren/VersionCheckType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">VersionCheckType</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren12LanguageType"></a>
|
||||
<a name="//apple_ref/swift/Enum/LanguageType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren12LanguageType">LanguageType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the available languages in which the update message and alert button titles should appear.</p>
|
||||
|
||||
<p>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()</p>
|
||||
|
||||
<a href="../Classes/Siren/LanguageType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">LanguageType</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,207 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlertType Enum Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/AlertType" class="dashAnchor"></a>
|
||||
<a title="AlertType Enum Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
AlertType Enum Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlertType</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">AlertType</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Determines the type of alert to present after a successful version check has been performed.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType5forceFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/force" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType5forceFMS1_S1_">force</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Forces user to update your app (1 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">force</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType6optionFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/option" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType6optionFMS1_S1_">option</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>(DEFAULT) Presents user with option to update app now or at next launch (2 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType4skipFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/skip" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType4skipFMS1_S1_">skip</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">skip</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType4noneFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/none" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType4noneFMS1_S1_">none</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Doesn’t show the alert, but instead returns a localized message
|
||||
for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="k">none</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>VersionCheckType Enum Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/VersionCheckType" class="dashAnchor"></a>
|
||||
<a title="VersionCheckType Enum Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
VersionCheckType Enum Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>VersionCheckType</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">VersionCheckType</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Determines the frequency in which the the version check is performed and the user is prompted to update the app.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType11immediatelyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/immediately" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType11immediatelyFMS1_S1_">immediately</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed every time the app is launched.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">immediately</span> <span class="o">=</span> <span class="mi">0</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType5dailyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/daily" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType5dailyFMS1_S1_">daily</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed once a day.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">daily</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType6weeklyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/weekly" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType6weeklyFMS1_S1_">weekly</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed once a week.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">weekly</span> <span class="o">=</span> <span class="mi">7</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Protocols Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">Siren Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Protocols Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/SirenDelegate%20Protocol"></a>
|
||||
<a name="//apple_ref/swift/Section/SirenDelegate Protocol" class="dashAnchor"></a>
|
||||
<a href="#/SirenDelegate%20Protocol">
|
||||
<h3 class="section-name">SirenDelegate Protocol</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P5Siren13SirenDelegate"></a>
|
||||
<a name="//apple_ref/swift/Protocol/SirenDelegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P5Siren13SirenDelegate">SirenDelegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Delegate that handles all codepaths for Siren upon version check completion.</p>
|
||||
|
||||
<a href="Protocols/SirenDelegate.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SirenDelegate</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,324 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>SirenDelegate Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Protocol/SirenDelegate" class="dashAnchor"></a>
|
||||
<a title="SirenDelegate Protocol Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
SirenDelegate Protocol Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>SirenDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SirenDelegate</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Delegate that handles all codepaths for Siren upon version check completion.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate24sirenDidShowUpdateDialogFT9alertTypeOCS_5Siren9AlertType_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidShowUpdateDialog(alertType:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate24sirenDidShowUpdateDialogFT9alertTypeOCS_5Siren9AlertType_T_">sirenDidShowUpdateDialog(alertType:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User presented with update dialog.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidShowUpdateDialog</span><span class="p">(</span><span class="nv">alertType</span><span class="p">:</span> <span class="kt"><a href="../Classes/Siren.html">Siren</a></span><span class="o">.</span><span class="kt">AlertType</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate26sirenUserDidLaunchAppStoreFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidLaunchAppStore()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate26sirenUserDidLaunchAppStoreFT_T_">sirenUserDidLaunchAppStore()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that launched App Store.app.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidLaunchAppStore</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate23sirenUserDidSkipVersionFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidSkipVersion()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate23sirenUserDidSkipVersionFT_T_">sirenUserDidSkipVersion()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that skips version update.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidSkipVersion</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate18sirenUserDidCancelFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidCancel()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate18sirenUserDidCancelFT_T_">sirenUserDidCancel()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that cancels update dialog.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidCancel</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate24sirenDidFailVersionCheckFT5errorCSo7NSError_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidFailVersionCheck(error:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate24sirenDidFailVersionCheckFT5errorCSo7NSError_T_">sirenDidFailVersionCheck(error:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren failed to perform version check (may return system-level error).</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidFailVersionCheck</span><span class="p">(</span><span class="nv">error</span><span class="p">:</span> <span class="kt">NSError</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate36sirenDidDetectNewVersionWithoutAlertFT7messageSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidDetectNewVersionWithoutAlert(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate36sirenDidDetectNewVersionWithoutAlertFT7messageSS_T_">sirenDidDetectNewVersionWithoutAlert(message:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren performed version check and did not display alert.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidDetectNewVersionWithoutAlert</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate27sirenLatestVersionInstalledFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenLatestVersionInstalled()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate27sirenLatestVersionInstalledFT_T_">sirenLatestVersionInstalled()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren performed version check and latest version is installed.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenLatestVersionInstalled</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="128" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h93v20H0z"/><path fill="#dfb317" d="M93 0h35v20H93z"/><path fill="url(#b)" d="M0 0h128v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="46.5" y="15" fill="#010101" fill-opacity=".3">documentation</text><text x="46.5" y="14">documentation</text><text x="109.5" y="15" fill="#010101" fill-opacity=".3">55%</text><text x="109.5" y="14">55%</text></g></svg>
|
||||
|
After Width: | Height: | Size: 808 B |
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,332 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none;
|
||||
white-space: nowrap; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.jazzy.siren</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Siren</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>siren</string>
|
||||
<key>isDashDocset</key>
|
||||
<true/>
|
||||
<key>dashIndexFilePath</key>
|
||||
<string>index.html</string>
|
||||
<key>isJavaScriptEnabled</key>
|
||||
<true/>
|
||||
<key>DashDocSetFamily</key>
|
||||
<string>dashtoc</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">Siren Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Siren"></a>
|
||||
<a name="//apple_ref/swift/Section/Siren" class="dashAnchor"></a>
|
||||
<a href="#/Siren">
|
||||
<h3 class="section-name">Siren</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C5Siren5Siren"></a>
|
||||
<a name="//apple_ref/swift/Class/Siren" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C5Siren5Siren">Siren</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Siren Class. A singleton that is initialized using the shared() method.</p>
|
||||
|
||||
<a href="Classes/Siren.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Siren</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,655 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Siren Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/Siren" class="dashAnchor"></a>
|
||||
<a title="Siren Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
Siren Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Siren</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Siren</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Siren Class. A singleton that is initialized using the shared() method.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren16SirenErrorDomainSS"></a>
|
||||
<a name="//apple_ref/swift/Property/SirenErrorDomain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren16SirenErrorDomainSS">SirenErrorDomain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The error domain for all errors created by Siren.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">SirenErrorDomain</span> <span class="o">=</span> <span class="s">"Siren Error Domain"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren8delegateXwGSqPS_13SirenDelegate__"></a>
|
||||
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren8delegateXwGSqPS_13SirenDelegate__">delegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The SirenDelegate variable, which should be set if you’d like to be notified:</p>
|
||||
|
||||
<p>When a user views or interacts with the alert
|
||||
- sirenDidShowUpdateDialog(alertType: AlertType)
|
||||
- sirenUserDidLaunchAppStore()
|
||||
- sirenUserDidSkipVersion()
|
||||
- sirenUserDidCancel()</p>
|
||||
|
||||
<p>When a new version has been detected, and you would like to present a localized message in a custom UI. use this delegate method:
|
||||
- sirenDidDetectNewVersionWithoutAlert(message: String)</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SirenDelegate.html">SirenDelegate</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren12debugEnabledSb"></a>
|
||||
<a name="//apple_ref/swift/Property/debugEnabled" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren12debugEnabledSb">debugEnabled</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The debug flag, which is disabled by default.
|
||||
When enabled, a stream of println() statements are logged to your console when a version check is performed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">debugEnabled</span> <span class="o">=</span> <span class="kc">false</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren9alertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/alertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren9alertTypeOS0_9AlertType">alertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the type of alert that should be shown.
|
||||
See the Siren.AlertType enum for full details.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">alertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20majorUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/majorUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20majorUpdateAlertTypeOS0_9AlertType">majorUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">majorUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20minorUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/minorUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20minorUpdateAlertTypeOS0_9AlertType">minorUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">minorUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren20patchUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/patchUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren20patchUpdateAlertTypeOS0_9AlertType">patchUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">patchUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren23revisionUpdateAlertTypeOS0_9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Property/revisionUpdateAlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren23revisionUpdateAlertTypeOS0_9AlertType">revisionUpdateAlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">revisionUpdateAlertType</span> <span class="o">=</span> <span class="kt"><a href="../Classes/Siren/AlertType.html">AlertType</a></span><span class="o">.</span><span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren7appNameSS"></a>
|
||||
<a name="//apple_ref/swift/Property/appName" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren7appNameSS">appName</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The name of your app.
|
||||
By default, it’s set to the name of the app that’s stored in your plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">appName</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="kt">Bundle</span><span class="o">.</span><span class="n">main</span><span class="o">.</span><span class="nf">bestMatchingAppName</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren11countryCodeGSqSS_"></a>
|
||||
<a name="//apple_ref/swift/Property/countryCode" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren11countryCodeGSqSS_">countryCode</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">countryCode</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren25forceLanguageLocalizationGSqOS0_12LanguageType_"></a>
|
||||
<a name="//apple_ref/swift/Property/forceLanguageLocalization" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren25forceLanguageLocalizationGSqOS0_12LanguageType_">forceLanguageLocalization</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">forceLanguageLocalization</span><span class="p">:</span> <span class="kt">Siren</span><span class="o">.</span><span class="kt"><a href="../Classes/Siren/LanguageType.html">LanguageType</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren24alertControllerTintColorGSqCSo7UIColor_"></a>
|
||||
<a name="//apple_ref/swift/Property/alertControllerTintColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren24alertControllerTintColorGSqCSo7UIColor_">alertControllerTintColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Overrides the tint color for UIAlertController.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">alertControllerTintColor</span><span class="p">:</span> <span class="kt">UIColor</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren50showAlertAfterCurrentVersionHasBeenReleasedForDaysSi"></a>
|
||||
<a name="//apple_ref/swift/Property/showAlertAfterCurrentVersionHasBeenReleasedForDays" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren50showAlertAfterCurrentVersionHasBeenReleasedForDaysSi">showAlertAfterCurrentVersionHasBeenReleasedForDays</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">showAlertAfterCurrentVersionHasBeenReleasedForDays</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC5Siren5Siren22currentAppStoreVersionGSqSS_"></a>
|
||||
<a name="//apple_ref/swift/Property/currentAppStoreVersion" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC5Siren5Siren22currentAppStoreVersionGSqSS_">currentAppStoreVersion</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The current version of your app that is available for download on the App Store</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">currentAppStoreVersion</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:ZvC5Siren5Siren6sharedS0_"></a>
|
||||
<a name="//apple_ref/swift/Variable/shared" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:ZvC5Siren5Siren6sharedS0_">shared</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The App’s Singleton</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">shared</span> <span class="o">=</span> <span class="kt">Siren</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC5Siren5Siren12checkVersionFT9checkTypeOS0_16VersionCheckType_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/checkVersion(checkType:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC5Siren5Siren12checkVersionFT9checkTypeOS0_16VersionCheckType_T_">checkVersion(checkType:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>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 <code><a href="../Classes/Siren.html#/s:vC5Siren5Siren11countryCodeGSqSS_">countryCode</a></code> property before calling this method. Please refer to the countryCode property for more information.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">checkVersion</span><span class="p">(</span><span class="nv">checkType</span><span class="p">:</span> <span class="kt"><a href="../Classes/Siren/VersionCheckType.html">VersionCheckType</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>checkType</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The frequency in days in which you want a check to be performed. Please refer to the Siren.VersionCheckType enum for more details.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren9AlertType"></a>
|
||||
<a name="//apple_ref/swift/Enum/AlertType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren9AlertType">AlertType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the type of alert to present after a successful version check has been performed.</p>
|
||||
|
||||
<a href="../Classes/Siren/AlertType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">AlertType</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren16VersionCheckType"></a>
|
||||
<a name="//apple_ref/swift/Enum/VersionCheckType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren16VersionCheckType">VersionCheckType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the frequency in which the the version check is performed and the user is prompted to update the app.</p>
|
||||
|
||||
<a href="../Classes/Siren/VersionCheckType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">VersionCheckType</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC5Siren5Siren12LanguageType"></a>
|
||||
<a name="//apple_ref/swift/Enum/LanguageType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC5Siren5Siren12LanguageType">LanguageType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Determines the available languages in which the update message and alert button titles should appear.</p>
|
||||
|
||||
<p>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()</p>
|
||||
|
||||
<a href="../Classes/Siren/LanguageType.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">LanguageType</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,207 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlertType Enum Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/AlertType" class="dashAnchor"></a>
|
||||
<a title="AlertType Enum Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
AlertType Enum Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlertType</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">AlertType</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Determines the type of alert to present after a successful version check has been performed.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType5forceFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/force" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType5forceFMS1_S1_">force</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Forces user to update your app (1 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">force</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType6optionFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/option" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType6optionFMS1_S1_">option</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>(DEFAULT) Presents user with option to update app now or at next launch (2 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">option</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType4skipFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/skip" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType4skipFMS1_S1_">skip</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Presents user with option to update the app now, at next launch, or to skip this version all together (3 button alert).</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">skip</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren9AlertType4noneFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/none" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren9AlertType4noneFMS1_S1_">none</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Doesn’t show the alert, but instead returns a localized message
|
||||
for use in a custom UI within the sirenDidDetectNewVersionWithoutAlert() delegate method.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="k">none</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
+1201
File diff suppressed because it is too large
Load Diff
+175
@@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>VersionCheckType Enum Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/VersionCheckType" class="dashAnchor"></a>
|
||||
<a title="VersionCheckType Enum Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
VersionCheckType Enum Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>VersionCheckType</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">VersionCheckType</span><span class="p">:</span> <span class="kt">Int</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Determines the frequency in which the the version check is performed and the user is prompted to update the app.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType11immediatelyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/immediately" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType11immediatelyFMS1_S1_">immediately</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed every time the app is launched.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">immediately</span> <span class="o">=</span> <span class="mi">0</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType5dailyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/daily" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType5dailyFMS1_S1_">daily</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed once a day.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">daily</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FOC5Siren5Siren16VersionCheckType6weeklyFMS1_S1_"></a>
|
||||
<a name="//apple_ref/swift/Element/weekly" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FOC5Siren5Siren16VersionCheckType6weeklyFMS1_S1_">weekly</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Version check performed once a week.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">weekly</span> <span class="o">=</span> <span class="mi">7</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Protocols Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">Siren Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Protocols Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/SirenDelegate%20Protocol"></a>
|
||||
<a name="//apple_ref/swift/Section/SirenDelegate Protocol" class="dashAnchor"></a>
|
||||
<a href="#/SirenDelegate%20Protocol">
|
||||
<h3 class="section-name">SirenDelegate Protocol</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P5Siren13SirenDelegate"></a>
|
||||
<a name="//apple_ref/swift/Protocol/SirenDelegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P5Siren13SirenDelegate">SirenDelegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Delegate that handles all codepaths for Siren upon version check completion.</p>
|
||||
|
||||
<a href="Protocols/SirenDelegate.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SirenDelegate</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,324 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>SirenDelegate Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Protocol/SirenDelegate" class="dashAnchor"></a>
|
||||
<a title="SirenDelegate Protocol Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">Siren Docs</a> (55% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/artsabintsev/siren"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">Siren Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
SirenDelegate Protocol Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren.html">Siren</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/VersionCheckType.html">– VersionCheckType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Siren/LanguageType.html">– LanguageType</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/SirenDelegate.html">SirenDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>SirenDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SirenDelegate</span><span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Delegate that handles all codepaths for Siren upon version check completion.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate24sirenDidShowUpdateDialogFT9alertTypeOCS_5Siren9AlertType_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidShowUpdateDialog(alertType:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate24sirenDidShowUpdateDialogFT9alertTypeOCS_5Siren9AlertType_T_">sirenDidShowUpdateDialog(alertType:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User presented with update dialog.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidShowUpdateDialog</span><span class="p">(</span><span class="nv">alertType</span><span class="p">:</span> <span class="kt"><a href="../Classes/Siren.html">Siren</a></span><span class="o">.</span><span class="kt">AlertType</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate26sirenUserDidLaunchAppStoreFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidLaunchAppStore()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate26sirenUserDidLaunchAppStoreFT_T_">sirenUserDidLaunchAppStore()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that launched App Store.app.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidLaunchAppStore</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate23sirenUserDidSkipVersionFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidSkipVersion()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate23sirenUserDidSkipVersionFT_T_">sirenUserDidSkipVersion()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that skips version update.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidSkipVersion</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate18sirenUserDidCancelFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenUserDidCancel()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate18sirenUserDidCancelFT_T_">sirenUserDidCancel()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>User did click on button that cancels update dialog.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenUserDidCancel</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate24sirenDidFailVersionCheckFT5errorCSo7NSError_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidFailVersionCheck(error:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate24sirenDidFailVersionCheckFT5errorCSo7NSError_T_">sirenDidFailVersionCheck(error:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren failed to perform version check (may return system-level error).</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidFailVersionCheck</span><span class="p">(</span><span class="nv">error</span><span class="p">:</span> <span class="kt">NSError</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate36sirenDidDetectNewVersionWithoutAlertFT7messageSS_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenDidDetectNewVersionWithoutAlert(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate36sirenDidDetectNewVersionWithoutAlertFT7messageSS_T_">sirenDidDetectNewVersionWithoutAlert(message:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren performed version check and did not display alert.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenDidDetectNewVersionWithoutAlert</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP5Siren13SirenDelegate27sirenLatestVersionInstalledFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/sirenLatestVersionInstalled()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP5Siren13SirenDelegate27sirenLatestVersionInstalledFT_T_">sirenLatestVersionInstalled()</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
</span>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Siren performed version check and latest version is installed.</p>
|
||||
|
||||
</div>
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sirenLatestVersionInstalled</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2015-2017 <a class="link" href="http://www.sabintsev.com" target="_blank" rel="external">Arthur Ariel Sabintsev</a></p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.5</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,332 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none;
|
||||
white-space: nowrap; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user