Compare commits
625 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bd43afc0c | |||
| be49cd82ff | |||
| 06994a9408 | |||
| dc787a23d7 | |||
| a1d30353df | |||
| b19712d8da | |||
| 245fec5abc | |||
| 34683f71fb | |||
| 251c186ff3 | |||
| 5b18c1606c | |||
| e1257d9eb6 | |||
| 516e368e82 | |||
| de01c00d2e | |||
| eb278bc030 | |||
| 367092af09 | |||
| ef6d9ffa42 | |||
| 3375ae2552 | |||
| 234d558b31 | |||
| 3ff9fff4c4 | |||
| 7b2f451643 | |||
| eee3edc923 | |||
| d59fbf6e5f | |||
| f042d70762 | |||
| a034d842de | |||
| 7470bcd720 | |||
| 47b0b5381e | |||
| 5ef05950ed | |||
| 84e728d65c | |||
| dcfe7df5ea | |||
| a759b4b947 | |||
| 5f70d96b2c | |||
| f9bc4dfb4f | |||
| 6947b485a5 | |||
| cb1febdaf3 | |||
| 2284e63c36 | |||
| af16cbbe20 | |||
| 38f6d9d1b5 | |||
| f9abb391d0 | |||
| a22230707a | |||
| fc155c83d5 | |||
| 298155897f | |||
| c9fb91a3ed | |||
| 07aa46fd1d | |||
| 448657eefe | |||
| 195de7391e | |||
| 4b88e28a99 | |||
| a420119765 | |||
| 1e759f197b | |||
| 93113a4f2e | |||
| c7df74e190 | |||
| 2591c0b3d4 | |||
| e669f8f5c0 | |||
| 77caddd434 | |||
| 8a0c03627c | |||
| c8519ea5be | |||
| 5d8f4800e1 | |||
| 2a4e5ceda3 | |||
| a3c7cfa26d | |||
| 8477f5fbe6 | |||
| 3c036ce559 | |||
| 212e68969a | |||
| 56a834ee41 | |||
| df6174ba06 | |||
| a11b7f0600 | |||
| de971bf52f | |||
| 5f00463928 | |||
| cf4274fb16 | |||
| a2cd55d83b | |||
| 3c064ffa4e | |||
| 84301d4ba2 | |||
| e226f934c0 | |||
| 33b6e60862 | |||
| fc64e7aca7 | |||
| f976791460 | |||
| 2a948f0133 | |||
| 2253c339ff | |||
| 85a8a4141d | |||
| fc8d7d80d0 | |||
| 7167868002 | |||
| ced4415181 | |||
| d28f69d7bc | |||
| 790d771a2a | |||
| eed4b9ac41 | |||
| cde489c888 | |||
| 6c8a47fb17 | |||
| 40fbca14a2 | |||
| c31afc015a | |||
| c508279a0c | |||
| 7502760c6e | |||
| eabb29fc8b | |||
| cc3b7b6715 | |||
| 1503bcbb1c | |||
| 15872781a8 | |||
| 4286f34b1d | |||
| 78526b17cb | |||
| 217883dc34 | |||
| a492985dcf | |||
| 85c6867a70 | |||
| dbfe20032f | |||
| 168cc437c1 | |||
| b65d0d9c75 | |||
| aee7eeca8a | |||
| dc63e9ea2f | |||
| 121178a603 | |||
| d946ccbc1b | |||
| 608329ec30 | |||
| 8686a397dd | |||
| 4dd7941d22 | |||
| a43d87d0ae | |||
| 9a72fcc164 | |||
| 2b15eb55aa | |||
| 364ba7d755 | |||
| fb9633cf25 | |||
| 417caff8b1 | |||
| a66052c592 | |||
| d152dc4887 | |||
| 7ff3f21945 | |||
| 5b3742175c | |||
| 2e0b11d30a | |||
| 7176b45aed | |||
| 954ce02353 | |||
| a3fbdfaee0 | |||
| 92c8ac45cc | |||
| 63ed8219dc | |||
| 2b482d367c | |||
| cc639488b3 | |||
| 0772192629 | |||
| c2449e25a2 | |||
| da0b258863 | |||
| 58da2806a1 | |||
| 25ec41abbd | |||
| 1c9dd88d68 | |||
| dd0966b29b | |||
| 421eb6802e | |||
| 01c33f99d6 | |||
| de925dc477 | |||
| bdf15f9be8 | |||
| 8cb742d2a6 | |||
| 2168a4f1fc | |||
| 1febce77dd | |||
| 2197494481 | |||
| 74284809e3 | |||
| 841d04dafd | |||
| d4c7baf247 | |||
| 6f0b8f733c | |||
| f217d5cd73 | |||
| 7cfd6e788f | |||
| 1a215cc608 | |||
| 7e30501d1c | |||
| 6df36c9c8c | |||
| d7bbe9e8a6 | |||
| 62b51d52a5 | |||
| 6aa91d26c4 | |||
| beb19f19c0 | |||
| 6e504a84a0 | |||
| 129bffe9d8 | |||
| cd4328feee | |||
| 1ac84cafc8 | |||
| 36bff434f6 | |||
| 94b319573e | |||
| 43abfabe15 | |||
| 9ac0dea011 | |||
| 9721263f90 | |||
| 124fd715ef | |||
| 1c3aee01fd | |||
| fe3b0acb6d | |||
| 509b5c9ca3 | |||
| 9c00d90424 | |||
| b4bba84753 | |||
| 47b95c97e0 | |||
| fedee61c34 | |||
| 0c5c0fd1bf | |||
| f2929ef72b | |||
| f19075e6b4 | |||
| 4063d7e061 | |||
| 75bf43da3c | |||
| 556382e38e | |||
| de480f9cb8 | |||
| 0643cd318c | |||
| c7ffac16a1 | |||
| 0f85e4087a | |||
| 1bdffa86fc | |||
| 8ffc87556c | |||
| 43a5d734c1 | |||
| 4fad697cd5 | |||
| 7ab708edf6 | |||
| 094b218c1d | |||
| 3117731c00 | |||
| 3d7ebea02f | |||
| 53f32cd3d5 | |||
| af6a9825e1 | |||
| bc570b028e | |||
| c37cd6968f | |||
| ef8498a8e6 | |||
| 10ddcab12c | |||
| 8344ed8cb3 | |||
| d3668c8943 | |||
| 4def0e9441 | |||
| fa692a3912 | |||
| 80a449975b | |||
| 3fd2f93d21 | |||
| 13ad9ba3da | |||
| 31a59a4b3c | |||
| 19f303535c | |||
| cdfae11e70 | |||
| 676b125666 | |||
| 3032aed434 | |||
| a9a5be48e6 | |||
| 6999fefad4 | |||
| 7ef6584c14 | |||
| ecf41d965c | |||
| 4338a2dae2 | |||
| e80a073fe9 | |||
| a1404096bf | |||
| cef1a7f560 | |||
| 7ef618d402 | |||
| 4b32315ad1 | |||
| 2504f5efc0 | |||
| 2acc8ee0c0 | |||
| 2c833b84ee | |||
| fd5aaabb99 | |||
| 4eb31510d0 | |||
| 8bb784a16b | |||
| c98b124f73 | |||
| 5e12e74e9c | |||
| 04ad0f1682 | |||
| 87a58c65de | |||
| c2e278df55 | |||
| dee7bc8e5e | |||
| e7fc566b10 | |||
| a4ab45f772 | |||
| c72eaf234c | |||
| edb8906b4d | |||
| b7fb413814 | |||
| 0246ee905a | |||
| 853eed62c4 | |||
| 4725475cfc | |||
| 1d03dc16e1 | |||
| 1d3be00440 | |||
| 42c5ab103d | |||
| a82d13d1a2 | |||
| 77cda5f933 | |||
| a5bd175373 | |||
| a95766201b | |||
| 6a7901f443 | |||
| 97b23f2804 | |||
| e475b18892 | |||
| c41f146a2d | |||
| 12ec30958c | |||
| cdb05f36a1 | |||
| 8a85468354 | |||
| 54e91577a7 | |||
| 171250c580 | |||
| 1b07f76f59 | |||
| b7819acbd5 | |||
| 2c10d82f7f | |||
| d7514471ba | |||
| b918235b4e | |||
| 6d1e626036 | |||
| e235f46b3b | |||
| 17f9952d8b | |||
| 5abf8ede8d | |||
| 8caddf0f8c | |||
| f6219ccb90 | |||
| 21e5f579e2 | |||
| 7c7791c17a | |||
| b03b7d12bf | |||
| 01e439d523 | |||
| 1701df1c72 | |||
| 6d5070cdb4 | |||
| 9460160937 | |||
| afeadfddfa | |||
| d234e8c472 | |||
| ca33c8f2c8 | |||
| 51eb58d236 | |||
| a8311bd6b9 | |||
| f8aa3f5534 | |||
| eba3e056c2 | |||
| 321ba43a15 | |||
| 0b9bae5cbb | |||
| c6b3ece14e | |||
| 6203ff3e17 | |||
| f9f9b82668 | |||
| 59e4b9e113 | |||
| a5a1797cce | |||
| 9eeb265614 | |||
| 31c0109adb | |||
| df3a8fd14f | |||
| c51fcc851b | |||
| add692995a | |||
| 379d4b3d82 | |||
| c402feabf1 | |||
| 1d563f89bf | |||
| 3a4d7dd841 | |||
| 543a3cc1cb | |||
| f44a3ba879 | |||
| 54b1042b5c | |||
| a904ca08df | |||
| 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 |
@@ -0,0 +1 @@
|
||||
docs/* linguist-vendored
|
||||
@@ -0,0 +1 @@
|
||||
* @artsabintsev
|
||||
@@ -0,0 +1,28 @@
|
||||
## If you're experiencing a problem integrating Siren into your app, please provide the following information when posting a new issue:
|
||||
|
||||
- **Are you using the [latest version](https://github.com/ArtSabintsev/Siren/releases) of Siren?**:
|
||||
- **What is your app's Bundle ID?**:
|
||||
- **When was the latest version of your app published to the App Store?**:
|
||||
- **Is your app published in the US App Store? If not, what App Store is it published in?**:
|
||||
- **Does Siren work if you plugin your app's `BundleID` (and `countryCode`, if necessary) into the Example app?**:
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
+1
-8
@@ -16,11 +16,4 @@ DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
|
||||
#
|
||||
# Pods/
|
||||
.DS_Store
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ruby-2.6.0
|
||||
@@ -0,0 +1,15 @@
|
||||
reporter: "xcode"
|
||||
|
||||
included:
|
||||
- ../Sources/
|
||||
|
||||
disabled_rules:
|
||||
- cyclomatic_complexity
|
||||
- line_length
|
||||
- nesting
|
||||
- unused_optional_binding
|
||||
- variable_name
|
||||
|
||||
# Specialized Rules
|
||||
file_length:
|
||||
- 500
|
||||
Generated
Executable → Regular
+1
-1
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Sample App.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
language: swift
|
||||
osx_image: xcode11
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
before_install:
|
||||
- brew update
|
||||
- gem install bundler
|
||||
env:
|
||||
- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
script:
|
||||
- set -o pipefail
|
||||
- xcodebuild -project Example/Example.xcodeproj -scheme Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
|
||||
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 |
@@ -1,43 +0,0 @@
|
||||
### Created and maintained by
|
||||
[Arthur Ariel Sabintsev](http://www.sabintsev.com/) and [Aaron Brager](http://twitter.com/GetAaron)
|
||||
|
||||
### Siren Project Contributors
|
||||
- [Dmitry Bespalov](https://github.com/diamondsky) for [Pull Request #7](https://github.com/ArtSabintsev/Siren/pull/7)
|
||||
- [Daniel Bauke](https://github.com/bonkey) for [Pull Request #8](https://github.com/ArtSabintsev/Siren/pull/8)
|
||||
- [ipedro](https://github.com/ipedro) for [Pull Request #76 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/76)
|
||||
- [Michael Graff](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)
|
||||
|
||||
### 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 v3.2.1, the version of Harpy that Siren was based on.
|
||||
|
||||
A huge **Thank You** to the following developers:
|
||||
|
||||
- [Borut Tomažin](https://github.com/borut-t)
|
||||
- [Bertie Liu](https://github.com/https://github.com/aceisScope)
|
||||
- [Burakkilic](https://github.com/burakkilic)
|
||||
- [Claas Lange](https://github.com/claaslange)
|
||||
- [Daniel](https://github.com/danieltskv)
|
||||
- [David Keegan](https://github.com/kgn)
|
||||
- [Erick](https://github.com/dexcell0)
|
||||
- [Ercillagorka](https://github.com/ercillagorka)
|
||||
- [Jamie Ly](http://github,com/jamiely)
|
||||
- [Jon Andersen](https://github.com/jonandersen)
|
||||
- [Josh T. Brown](https://github.com/joshuatbrown)
|
||||
- [Mark Rickert](https://github.com/markrickert)
|
||||
- [Patrick Debois](https://github.com/jedi4ever)
|
||||
- [Pius Uzamere](https://github.com/pius)
|
||||
- [Rahul Jiresal](https://github.com/rahuljiresal)
|
||||
- [Rui Peres](https://github.com/RuiAAPeres)
|
||||
- [Thomas Hempel](https://github.com/thomashempel)
|
||||
- [TrentW](https://github.com/trentw)
|
||||
|
||||
### Special Thanks
|
||||
Finally, a massive **Thank You** to [Aaron Brager](http://twitter.com/GetAaron) for the dev-work and issue-moderation he's done on Harpy since 2012. A Swift port could not have happened without him.
|
||||
Executable
+811
@@ -0,0 +1,811 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8E1635A91E6A0B9C0060CE27 /* SirenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */; };
|
||||
8EACA9711F380294003134CA /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA9671F37F2D3003134CA /* LaunchScreen.xib */; };
|
||||
8EACA9721F380294003134CA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA9691F37F2D3003134CA /* Main.storyboard */; };
|
||||
8EACA9731F380294003134CA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8EACA96B1F37F2D3003134CA /* Images.xcassets */; };
|
||||
8EACA9741F38029B003134CA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EACA9661F37F2D3003134CA /* AppDelegate.swift */; };
|
||||
8EACA9751F38029B003134CA /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EACA96D1F37F2D3003134CA /* ViewController.swift */; };
|
||||
8EF9F879224EACB200B20545 /* APIManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F861224EACB100B20545 /* APIManager.swift */; };
|
||||
8EF9F87A224EACB200B20545 /* RulesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F862224EACB100B20545 /* RulesManager.swift */; };
|
||||
8EF9F87B224EACB200B20545 /* PresentationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F863224EACB100B20545 /* PresentationManager.swift */; };
|
||||
8EF9F87C224EACB200B20545 /* AlertAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F865224EACB100B20545 /* AlertAction.swift */; };
|
||||
8EF9F87D224EACB200B20545 /* AlertConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F866224EACB100B20545 /* AlertConstants.swift */; };
|
||||
8EF9F87E224EACB200B20545 /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F867224EACB100B20545 /* Localization.swift */; };
|
||||
8EF9F87F224EACB200B20545 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F868224EACB100B20545 /* Model.swift */; };
|
||||
8EF9F880224EACB200B20545 /* APIModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F869224EACB100B20545 /* APIModel.swift */; };
|
||||
8EF9F881224EACB200B20545 /* Rules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F86A224EACB100B20545 /* Rules.swift */; };
|
||||
8EF9F882224EACB200B20545 /* PerformCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F86B224EACB100B20545 /* PerformCheck.swift */; };
|
||||
8EF9F883224EACB200B20545 /* UpdateResults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F86C224EACB100B20545 /* UpdateResults.swift */; };
|
||||
8EF9F884224EACB200B20545 /* Siren.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F86D224EACB100B20545 /* Siren.swift */; };
|
||||
8EF9F885224EACB200B20545 /* UIAlertControllerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F86F224EACB100B20545 /* UIAlertControllerExtension.swift */; };
|
||||
8EF9F886224EACB200B20545 /* BundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F870224EACB100B20545 /* BundleExtension.swift */; };
|
||||
8EF9F887224EACB200B20545 /* UserDefaultsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F871224EACB100B20545 /* UserDefaultsExtension.swift */; };
|
||||
8EF9F888224EACB200B20545 /* DateExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F872224EACB100B20545 /* DateExtension.swift */; };
|
||||
8EF9F889224EACB200B20545 /* DataParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F874224EACB200B20545 /* DataParser.swift */; };
|
||||
8EF9F88A224EACB200B20545 /* KnownError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F875224EACB200B20545 /* KnownError.swift */; };
|
||||
8EF9F88B224EACB200B20545 /* Siren.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8EF9F876224EACB200B20545 /* Siren.bundle */; };
|
||||
8EF9F88C224EACB200B20545 /* SirenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EF9F878224EACB200B20545 /* SirenViewController.swift */; };
|
||||
8EF9F88E224EB00100B20545 /* Siren.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EF9F853224EACA500B20545 /* Siren.framework */; };
|
||||
8EF9F88F224EB00100B20545 /* Siren.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8EF9F853224EACA500B20545 /* Siren.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
8E3A6C091D07CB6F00A8B7CF /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 8EC391791A58B465001C121E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8EC391801A58B465001C121E;
|
||||
remoteInfo = "Sample App";
|
||||
};
|
||||
8EF9F890224EB00100B20545 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 8EC391791A58B465001C121E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8EF9F852224EACA500B20545;
|
||||
remoteInfo = Siren;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
8EF9F892224EB00200B20545 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
8EF9F88F224EB00100B20545 /* Siren.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
55EC364A1E6BB98A00726F13 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../Siren/Info.plist; sourceTree = "<group>"; };
|
||||
8E3A6C041D07CB6F00A8B7CF /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8EACA9661F37F2D3003134CA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
8EACA9681F37F2D3003134CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
8EACA96A1F37F2D3003134CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
8EACA96B1F37F2D3003134CA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
8EACA96C1F37F2D3003134CA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8EACA96D1F37F2D3003134CA /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
8EC391811A58B465001C121E /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
8EF9F853224EACA500B20545 /* Siren.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Siren.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8EF9F856224EACA500B20545 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8EF9F861224EACB100B20545 /* APIManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIManager.swift; sourceTree = "<group>"; };
|
||||
8EF9F862224EACB100B20545 /* RulesManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RulesManager.swift; sourceTree = "<group>"; };
|
||||
8EF9F863224EACB100B20545 /* PresentationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentationManager.swift; sourceTree = "<group>"; };
|
||||
8EF9F865224EACB100B20545 /* AlertAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertAction.swift; sourceTree = "<group>"; };
|
||||
8EF9F866224EACB100B20545 /* AlertConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertConstants.swift; sourceTree = "<group>"; };
|
||||
8EF9F867224EACB100B20545 /* Localization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Localization.swift; sourceTree = "<group>"; };
|
||||
8EF9F868224EACB100B20545 /* Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
|
||||
8EF9F869224EACB100B20545 /* APIModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIModel.swift; sourceTree = "<group>"; };
|
||||
8EF9F86A224EACB100B20545 /* Rules.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rules.swift; sourceTree = "<group>"; };
|
||||
8EF9F86B224EACB100B20545 /* PerformCheck.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerformCheck.swift; sourceTree = "<group>"; };
|
||||
8EF9F86C224EACB100B20545 /* UpdateResults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdateResults.swift; sourceTree = "<group>"; };
|
||||
8EF9F86D224EACB100B20545 /* Siren.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Siren.swift; path = ../../Sources/Siren.swift; sourceTree = "<group>"; };
|
||||
8EF9F86F224EACB100B20545 /* UIAlertControllerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAlertControllerExtension.swift; sourceTree = "<group>"; };
|
||||
8EF9F870224EACB100B20545 /* BundleExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BundleExtension.swift; sourceTree = "<group>"; };
|
||||
8EF9F871224EACB100B20545 /* UserDefaultsExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserDefaultsExtension.swift; sourceTree = "<group>"; };
|
||||
8EF9F872224EACB100B20545 /* DateExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateExtension.swift; sourceTree = "<group>"; };
|
||||
8EF9F874224EACB200B20545 /* DataParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataParser.swift; sourceTree = "<group>"; };
|
||||
8EF9F875224EACB200B20545 /* KnownError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KnownError.swift; sourceTree = "<group>"; };
|
||||
8EF9F876224EACB200B20545 /* Siren.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Siren.bundle; path = ../../Sources/Siren.bundle; sourceTree = "<group>"; };
|
||||
8EF9F878224EACB200B20545 /* SirenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SirenViewController.swift; sourceTree = "<group>"; };
|
||||
8EF9F88D224EACBF00B20545 /* Siren.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Siren.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8E3A6C011D07CB6F00A8B7CF /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917E1A58B465001C121E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EF9F88E224EB00100B20545 /* Siren.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EF9F850224EACA500B20545 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
8E641D2420C8B44B00908555 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EACA9651F37F2D3003134CA /* Example */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EACA9661F37F2D3003134CA /* AppDelegate.swift */,
|
||||
8EACA96E1F37F2DD003134CA /* Supporting Files */,
|
||||
);
|
||||
path = Example;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EACA96E1F37F2DD003134CA /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EACA9671F37F2D3003134CA /* LaunchScreen.xib */,
|
||||
8EACA9691F37F2D3003134CA /* Main.storyboard */,
|
||||
8EACA96B1F37F2D3003134CA /* Images.xcassets */,
|
||||
8EACA96C1F37F2D3003134CA /* Info.plist */,
|
||||
8EACA96D1F37F2D3003134CA /* ViewController.swift */,
|
||||
55EC364A1E6BB98A00726F13 /* Info.plist */,
|
||||
);
|
||||
path = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391781A58B465001C121E = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EACA9651F37F2D3003134CA /* Example */,
|
||||
8EE6C74A1E6A0AE100DBE454 /* Tests */,
|
||||
8EF9F854224EACA500B20545 /* Siren */,
|
||||
8EC391821A58B465001C121E /* Products */,
|
||||
8E641D2420C8B44B00908555 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EC391821A58B465001C121E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EC391811A58B465001C121E /* Example.app */,
|
||||
8E3A6C041D07CB6F00A8B7CF /* Tests.xctest */,
|
||||
8EF9F853224EACA500B20545 /* Siren.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EE6C74A1E6A0AE100DBE454 /* Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EE6C74B1E6A0AE100DBE454 /* Info.plist */,
|
||||
8EE6C74C1E6A0AE100DBE454 /* SirenTests.swift */,
|
||||
);
|
||||
path = Tests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F854224EACA500B20545 /* Siren */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F86D224EACB100B20545 /* Siren.swift */,
|
||||
8EF9F876224EACB200B20545 /* Siren.bundle */,
|
||||
8EF9F86E224EACB100B20545 /* Extensions */,
|
||||
8EF9F860224EACB100B20545 /* Managers */,
|
||||
8EF9F864224EACB100B20545 /* Models */,
|
||||
8EF9F873224EACB200B20545 /* Utilities */,
|
||||
8EF9F877224EACB200B20545 /* View Controllers */,
|
||||
8EF9F88D224EACBF00B20545 /* Siren.h */,
|
||||
8EF9F856224EACA500B20545 /* Info.plist */,
|
||||
);
|
||||
path = Siren;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F860224EACB100B20545 /* Managers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F861224EACB100B20545 /* APIManager.swift */,
|
||||
8EF9F862224EACB100B20545 /* RulesManager.swift */,
|
||||
8EF9F863224EACB100B20545 /* PresentationManager.swift */,
|
||||
);
|
||||
name = Managers;
|
||||
path = ../../Sources/Managers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F864224EACB100B20545 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F865224EACB100B20545 /* AlertAction.swift */,
|
||||
8EF9F866224EACB100B20545 /* AlertConstants.swift */,
|
||||
8EF9F869224EACB100B20545 /* APIModel.swift */,
|
||||
8EF9F867224EACB100B20545 /* Localization.swift */,
|
||||
8EF9F868224EACB100B20545 /* Model.swift */,
|
||||
8EF9F86A224EACB100B20545 /* Rules.swift */,
|
||||
8EF9F86B224EACB100B20545 /* PerformCheck.swift */,
|
||||
8EF9F86C224EACB100B20545 /* UpdateResults.swift */,
|
||||
);
|
||||
name = Models;
|
||||
path = ../../Sources/Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F86E224EACB100B20545 /* Extensions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F86F224EACB100B20545 /* UIAlertControllerExtension.swift */,
|
||||
8EF9F870224EACB100B20545 /* BundleExtension.swift */,
|
||||
8EF9F871224EACB100B20545 /* UserDefaultsExtension.swift */,
|
||||
8EF9F872224EACB100B20545 /* DateExtension.swift */,
|
||||
);
|
||||
name = Extensions;
|
||||
path = ../../Sources/Extensions;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F873224EACB200B20545 /* Utilities */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F874224EACB200B20545 /* DataParser.swift */,
|
||||
8EF9F875224EACB200B20545 /* KnownError.swift */,
|
||||
);
|
||||
name = Utilities;
|
||||
path = ../../Sources/Utilities;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EF9F877224EACB200B20545 /* View Controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EF9F878224EACB200B20545 /* SirenViewController.swift */,
|
||||
);
|
||||
name = "View Controllers";
|
||||
path = "../../Sources/View Controllers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8EF9F84E224EACA500B20545 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8E3A6C031D07CB6F00A8B7CF /* Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8E3A6C0D1D07CB6F00A8B7CF /* Build configuration list for PBXNativeTarget "Tests" */;
|
||||
buildPhases = (
|
||||
8E3A6C001D07CB6F00A8B7CF /* Sources */,
|
||||
8E3A6C011D07CB6F00A8B7CF /* Frameworks */,
|
||||
8E3A6C021D07CB6F00A8B7CF /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8E3A6C0A1D07CB6F00A8B7CF /* PBXTargetDependency */,
|
||||
);
|
||||
name = Tests;
|
||||
productName = SirenTests;
|
||||
productReference = 8E3A6C041D07CB6F00A8B7CF /* Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
8EC391801A58B465001C121E /* Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "Example" */;
|
||||
buildPhases = (
|
||||
8EC3917D1A58B465001C121E /* Sources */,
|
||||
8EC3917E1A58B465001C121E /* Frameworks */,
|
||||
8EE3A3F81E6A0E470010BDCE /* SwiftLint */,
|
||||
8EC3917F1A58B465001C121E /* Resources */,
|
||||
8EF9F892224EB00200B20545 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8EF9F891224EB00100B20545 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Example;
|
||||
productName = Siren;
|
||||
productReference = 8EC391811A58B465001C121E /* Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
8EF9F852224EACA500B20545 /* Siren */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8EF9F85C224EACA500B20545 /* Build configuration list for PBXNativeTarget "Siren" */;
|
||||
buildPhases = (
|
||||
8EF9F84E224EACA500B20545 /* Headers */,
|
||||
8EF9F84F224EACA500B20545 /* Sources */,
|
||||
8EF9F850224EACA500B20545 /* Frameworks */,
|
||||
8EF9F851224EACA500B20545 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Siren;
|
||||
productName = Siren;
|
||||
productReference = 8EF9F853224EACA500B20545 /* Siren.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
8EC391791A58B465001C121E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "Sabintsev iOS Projects";
|
||||
TargetAttributes = {
|
||||
8E3A6C031D07CB6F00A8B7CF = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 1020;
|
||||
TestTargetID = 8EC391801A58B465001C121E;
|
||||
};
|
||||
8EC391801A58B465001C121E = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
DevelopmentTeam = HT94948NDD;
|
||||
DevelopmentTeamName = "Arthur Sabintsev";
|
||||
LastSwiftMigration = 1020;
|
||||
SystemCapabilities = {
|
||||
com.apple.BackgroundModes = {
|
||||
enabled = 0;
|
||||
};
|
||||
com.apple.InAppPurchase = {
|
||||
enabled = 0;
|
||||
};
|
||||
com.apple.Push = {
|
||||
enabled = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
8EF9F852224EACA500B20545 = {
|
||||
CreatedOnToolsVersion = 10.2;
|
||||
DevelopmentTeam = HT94948NDD;
|
||||
LastSwiftMigration = 1020;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "Example" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 8EC391781A58B465001C121E;
|
||||
productRefGroup = 8EC391821A58B465001C121E /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8EC391801A58B465001C121E /* Example */,
|
||||
8E3A6C031D07CB6F00A8B7CF /* Tests */,
|
||||
8EF9F852224EACA500B20545 /* Siren */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8E3A6C021D07CB6F00A8B7CF /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917F1A58B465001C121E /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EACA9711F380294003134CA /* LaunchScreen.xib in Resources */,
|
||||
8EACA9721F380294003134CA /* Main.storyboard in Resources */,
|
||||
8EACA9731F380294003134CA /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EF9F851224EACA500B20545 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EF9F88B224EACB200B20545 /* Siren.bundle 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 */
|
||||
8E3A6C001D07CB6F00A8B7CF /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8E1635A91E6A0B9C0060CE27 /* SirenTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EC3917D1A58B465001C121E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EACA9741F38029B003134CA /* AppDelegate.swift in Sources */,
|
||||
8EACA9751F38029B003134CA /* ViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8EF9F84F224EACA500B20545 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EF9F882224EACB200B20545 /* PerformCheck.swift in Sources */,
|
||||
8EF9F87F224EACB200B20545 /* Model.swift in Sources */,
|
||||
8EF9F885224EACB200B20545 /* UIAlertControllerExtension.swift in Sources */,
|
||||
8EF9F88C224EACB200B20545 /* SirenViewController.swift in Sources */,
|
||||
8EF9F886224EACB200B20545 /* BundleExtension.swift in Sources */,
|
||||
8EF9F87D224EACB200B20545 /* AlertConstants.swift in Sources */,
|
||||
8EF9F881224EACB200B20545 /* Rules.swift in Sources */,
|
||||
8EF9F889224EACB200B20545 /* DataParser.swift in Sources */,
|
||||
8EF9F879224EACB200B20545 /* APIManager.swift in Sources */,
|
||||
8EF9F87E224EACB200B20545 /* Localization.swift in Sources */,
|
||||
8EF9F880224EACB200B20545 /* APIModel.swift in Sources */,
|
||||
8EF9F888224EACB200B20545 /* DateExtension.swift in Sources */,
|
||||
8EF9F884224EACB200B20545 /* Siren.swift in Sources */,
|
||||
8EF9F887224EACB200B20545 /* UserDefaultsExtension.swift in Sources */,
|
||||
8EF9F87B224EACB200B20545 /* PresentationManager.swift in Sources */,
|
||||
8EF9F883224EACB200B20545 /* UpdateResults.swift in Sources */,
|
||||
8EF9F87C224EACB200B20545 /* AlertAction.swift in Sources */,
|
||||
8EF9F88A224EACB200B20545 /* KnownError.swift in Sources */,
|
||||
8EF9F87A224EACB200B20545 /* RulesManager.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
8E3A6C0A1D07CB6F00A8B7CF /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8EC391801A58B465001C121E /* Example */;
|
||||
targetProxy = 8E3A6C091D07CB6F00A8B7CF /* PBXContainerItemProxy */;
|
||||
};
|
||||
8EF9F891224EB00100B20545 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8EF9F852224EACA500B20545 /* Siren */;
|
||||
targetProxy = 8EF9F890224EB00100B20545 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
8EACA9671F37F2D3003134CA /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8EACA9681F37F2D3003134CA /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EACA9691F37F2D3003134CA /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8EACA96A1F37F2D3003134CA /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
8E3A6C0B1D07CB6F00A8B7CF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = Tests/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 = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8E3A6C0C1D07CB6F00A8B7CF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
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 = Tests/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 = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
|
||||
};
|
||||
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_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
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";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
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_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
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;
|
||||
SWIFT_VERSION = 4.2;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8EC391A11A58B466001C121E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = HT94948NDD;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Siren/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.apple.AppStoreConnect;
|
||||
PRODUCT_NAME = Example;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EC391A21A58B466001C121E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = HT94948NDD;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Siren/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.apple.AppStoreConnect;
|
||||
PRODUCT_NAME = Example;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8EF9F85D224EACA500B20545 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = HT94948NDD;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.Sabintsev.Siren;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8EF9F85E224EACA500B20545 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = HT94948NDD;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.Sabintsev.Siren;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
8E3A6C0D1D07CB6F00A8B7CF /* Build configuration list for PBXNativeTarget "Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8E3A6C0B1D07CB6F00A8B7CF /* Debug */,
|
||||
8E3A6C0C1D07CB6F00A8B7CF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EC3917C1A58B465001C121E /* Build configuration list for PBXProject "Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC3919E1A58B466001C121E /* Debug */,
|
||||
8EC3919F1A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EC391A01A58B466001C121E /* Build configuration list for PBXNativeTarget "Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EC391A11A58B466001C121E /* Debug */,
|
||||
8EC391A21A58B466001C121E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8EF9F85C224EACA500B20545 /* Build configuration list for PBXNativeTarget "Siren" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8EF9F85D224EACA500B20545 /* Debug */,
|
||||
8EF9F85E224EACA500B20545 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 8EC391791A58B465001C121E /* Project object */;
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/Arthur/Documents/oss/siren/SirenExample/Example.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
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 = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:Example.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 = "Tests.xctest"
|
||||
BlueprintName = "Tests"
|
||||
ReferencedContainer = "container:Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EC391801A58B465001C121E"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:Example.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 = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:Example.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 = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EF9F852224EACA500B20545"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:Example.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 = "8EF9F852224EACA500B20545"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8EF9F852224EACA500B20545"
|
||||
BuildableName = "Siren.framework"
|
||||
BlueprintName = "Siren"
|
||||
ReferencedContainer = "container:Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
Executable
+268
@@ -0,0 +1,268 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Siren
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
/// - Warning:
|
||||
/// Siren should ONLY be placed in UIApplication.didFinishLaunchingWithOptions and only after the `window?.makeKeyAndVisible()` call.
|
||||
/// Siren initializes a listener on `didBecomeActiveNotification` to perform version checks.
|
||||
|
||||
// defaultExample()
|
||||
// defaultExampleUsingCompletionHandler()
|
||||
// manualExampleWithCompletionHandler()
|
||||
// minimalCustomizationPresentationExample()
|
||||
// forceLocalizationCustomizationPresentationExample()
|
||||
// customMessagingPresentationExample()
|
||||
annoyingRuleExample()
|
||||
// hyperCriticalRulesExample()
|
||||
// updateSpecificRulesExample()
|
||||
// customAlertRulesExample()
|
||||
// appStoreCountryChangeExample()
|
||||
// complexExample()
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// Examples on how to use Siren
|
||||
|
||||
private extension AppDelegate {
|
||||
|
||||
/// The simplest implementation of Siren.
|
||||
/// All default rules are implemented and the
|
||||
/// results of the completion handler are ignored.
|
||||
func defaultExample() {
|
||||
Siren.shared.wail()
|
||||
}
|
||||
|
||||
/// The simplest implementation of Siren.
|
||||
/// All default rules are implemented and the
|
||||
/// results of the completion handler are returned or an error is returned.
|
||||
func defaultExampleUsingCompletionHandler() {
|
||||
Siren.shared.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Rather than waiting for `didBecomeActive` state changes (e.g., app launching/relaunching),
|
||||
/// Siren's version checking and alert presentation methods will be triggered each time this method is called.
|
||||
func manualExampleWithCompletionHandler() {
|
||||
Siren.shared.wail(performCheck: .onDemand) { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Minor customization to Siren's update alert presentation.
|
||||
func minimalCustomizationPresentationExample() {
|
||||
let siren = Siren.shared
|
||||
siren.presentationManager = PresentationManager(alertTintColor: .purple,
|
||||
appName: "Siren Example App Override!")
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Forcing the language of the update alert to a specific localization (e.g., Russian is force in this function.
|
||||
func forceLocalizationCustomizationPresentationExample() {
|
||||
let siren = Siren.shared
|
||||
siren.presentationManager = PresentationManager(forceLanguageLocalization: .russian)
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Example on how to change specific strings in the update alert.
|
||||
func customMessagingPresentationExample() {
|
||||
let siren = Siren.shared
|
||||
siren.presentationManager = PresentationManager(alertTitle: "Update Now, OK?",
|
||||
nextTimeButtonTitle: "Next time, please!?")
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// How to present an alert every time the app is foregrounded.
|
||||
func annoyingRuleExample() {
|
||||
let siren = Siren.shared
|
||||
siren.rulesManager = RulesManager(globalRules: .annoying)
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// How to present an alert every time the app is foregrounded.
|
||||
/// This will block the user from using the app until they update the app.
|
||||
/// Setting `showAlertAfterCurrentVersionHasBeenReleasedForDays` to `0` IS NOT RECOMMENDED
|
||||
/// as it will cause the user to go into an endless loop to the App Store if the JSON results
|
||||
/// update faster than the App Store CDN.
|
||||
///
|
||||
/// The `0` value is illustrated in this app as an example on how to change how quickly an alert is presented.
|
||||
func hyperCriticalRulesExample() {
|
||||
let siren = Siren.shared
|
||||
siren.rulesManager = RulesManager(globalRules: .critical,
|
||||
showAlertAfterCurrentVersionHasBeenReleasedForDays: 0)
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Major, Minor, Patch, and Revision specific rules implementations.
|
||||
func updateSpecificRulesExample() {
|
||||
let siren = Siren.shared
|
||||
siren.rulesManager = RulesManager(majorUpdateRules: .critical,
|
||||
minorUpdateRules: .annoying,
|
||||
patchUpdateRules: .default,
|
||||
revisionUpdateRules: Rules(promptFrequency: .weekly, forAlertType: .option))
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An example on how to present your own custom alert using Siren's localized Strings and version checking cadence.
|
||||
func customAlertRulesExample() {
|
||||
let siren = Siren.shared
|
||||
// The key for using custom alerts is to set the `alertType` to `.none`.
|
||||
// The `Results` type will return localized strings for your app's custom modal presentation.
|
||||
// The `promptFrequency` allows you to customize how often Siren performs the version check before returning a non-error result back into your app, prompting your custom alert functionality.
|
||||
let rules = Rules(promptFrequency: .immediately, forAlertType: .none)
|
||||
siren.rulesManager = RulesManager(globalRules: rules)
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An example on how to change the App Store region that your app in which your app is available.
|
||||
// This should only be used if your app is not available in the US App Store.
|
||||
// This example function illustrates how this can be done by checking against the Russian App Store.
|
||||
func appStoreCountryChangeExample() {
|
||||
let siren = Siren.shared
|
||||
siren.apiManager = APIManager(countryCode: "RU")
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An example on how to customize multiple managers at once.
|
||||
func complexExample() {
|
||||
let siren = Siren.shared
|
||||
siren.presentationManager = PresentationManager(alertTintColor: .brown,
|
||||
appName: "Siren's Complex Rule Example App",
|
||||
alertTitle: "Please, Update Now!",
|
||||
skipButtonTitle: "Click here to skip!",
|
||||
forceLanguageLocalization: .spanish)
|
||||
siren.rulesManager = RulesManager(majorUpdateRules: .critical,
|
||||
minorUpdateRules: .annoying,
|
||||
patchUpdateRules: .default,
|
||||
revisionUpdateRules: .relaxed)
|
||||
|
||||
siren.wail { results in
|
||||
switch results {
|
||||
case .success(let updateResults):
|
||||
print("AlertAction ", updateResults.alertAction)
|
||||
print("Localization ", updateResults.localization)
|
||||
print("Model ", updateResults.model)
|
||||
print("UpdateType ", updateResults.updateType)
|
||||
case .failure(let error):
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+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="8187.4" systemVersion="14F27" 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="8151.3"/>
|
||||
<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"/>
|
||||
+10
-6
@@ -1,22 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8187.4" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8151.3"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="Sample_App" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<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"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
+15
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
@@ -29,6 +39,11 @@
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<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>
|
||||
@@ -15,9 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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>$(DEVELOPMENT_LANGUAGE)</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.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Siren.h
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/29/19.
|
||||
// Copyright © 2019 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>
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,811 @@
|
||||
//
|
||||
// SirenTests.swift
|
||||
// SirenTests
|
||||
//
|
||||
// Created by Arthur Sabintsev on 6/7/16.
|
||||
// Copyright © 2016 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import Siren
|
||||
|
||||
final class SirenTests: XCTestCase {
|
||||
|
||||
var siren: Siren = Siren.shared
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Updates
|
||||
|
||||
extension SirenTests {
|
||||
|
||||
func testSingleDigitVersionUpdate() {
|
||||
siren.currentInstalledVersion = "1"
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0.0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.0.9"))
|
||||
}
|
||||
|
||||
func testDoubleDigitVersionUpdate() {
|
||||
siren.currentInstalledVersion = "1.0"
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0.0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.0.9"))
|
||||
}
|
||||
|
||||
func testTripleDigitVersionUpdate() {
|
||||
siren.currentInstalledVersion = "1.0.0"
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0.0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.0.9"))
|
||||
}
|
||||
|
||||
func testQuadrupleDigitVersionUpdate() {
|
||||
siren.currentInstalledVersion = "1.0.0"
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0"))
|
||||
|
||||
XCTAssertTrue(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "2.0.0.0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.9"))
|
||||
|
||||
XCTAssertFalse(DataParser.isAppStoreVersionNewer(installedVersion: siren.currentInstalledVersion,
|
||||
appStoreVersion: "0.0.0.9"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Localization
|
||||
|
||||
extension SirenTests {
|
||||
|
||||
func testArabicLocalization() {
|
||||
let language: Localization.Language = .arabic
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "التحديث متوفر")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "المرة التالية")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "تخطى عن هذه النسخة")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "تحديث")
|
||||
}
|
||||
|
||||
func testArmenianLocalization() {
|
||||
let language: Localization.Language = .armenian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Թարմացումը հասանելի Է")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Հաջորդ անգամ")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Բաց թողնել այս տարբերակը")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Թարմացնել")
|
||||
}
|
||||
|
||||
func testBasqueLocalization() {
|
||||
let language: Localization.Language = .basque
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Eguneratzea erabilgarri")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Hurrengo batean")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Bertsio honetatik jauzi egin")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Eguneratu")
|
||||
}
|
||||
|
||||
func testChineseSimplifiedLocalization() {
|
||||
let language: Localization.Language = .chineseSimplified
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "更新可用")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "下一次")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "跳过此版本")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "更新")
|
||||
}
|
||||
|
||||
func testChineseTraditionalLocalization() {
|
||||
let language: Localization.Language = .chineseTraditional
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "有更新可用")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "下次")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "跳過此版本")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "更新")
|
||||
}
|
||||
|
||||
func testCroatianLocalization() {
|
||||
let language: Localization.Language = .croatian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Nova ažuriranje je stigla")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Sljedeći put")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Preskoči ovu verziju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ažuriraj")
|
||||
}
|
||||
|
||||
func testCzechLocalization() {
|
||||
let language: Localization.Language = .czech
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aktualizace dostupná")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Příště")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Přeskočit tuto verzi")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Aktualizovat")
|
||||
}
|
||||
|
||||
func testDanishLocalization() {
|
||||
let language: Localization.Language = .danish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Tilgængelig opdatering")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Næste gang")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Spring denne version over")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Opdater")
|
||||
}
|
||||
|
||||
func testDutchLocalization() {
|
||||
let language: Localization.Language = .dutch
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Update beschikbaar")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Volgende keer")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Sla deze versie over")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Updaten")
|
||||
}
|
||||
|
||||
func testEstonianLocalization() {
|
||||
let language: Localization.Language = .estonian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Uuendus saadaval")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Järgmisel korral")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Jäta see version vahele")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Uuenda")
|
||||
}
|
||||
|
||||
func testFinnishLocalization() {
|
||||
let language: Localization.Language = .finnish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Päivitys saatavilla")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Ensi kerralla")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Jätä tämä versio väliin")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Päivitys")
|
||||
}
|
||||
|
||||
func testFrenchLocalization() {
|
||||
let language: Localization.Language = .french
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Mise à jour disponible")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La prochaine fois")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Sauter cette version")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Mettre à jour")
|
||||
}
|
||||
|
||||
func testGermanLocalization() {
|
||||
let language: Localization.Language = .german
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Update erhältlich")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Später")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Diese Version überspringen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Update")
|
||||
}
|
||||
|
||||
func testGreekLocalization() {
|
||||
let language: Localization.Language = .greek
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Διαθέσιμη Ενημέρωση")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Άλλη φορά")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Αγνόησε αυτήν την έκδοση")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Αναβάθμιση")
|
||||
}
|
||||
|
||||
func testHebrewLocalization() {
|
||||
let language: Localization.Language = .hebrew
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "עדכון זמין")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "בפעם הבאה")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "דלג על גרסה זו")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "עדכן")
|
||||
}
|
||||
|
||||
func testHungarianLocalization() {
|
||||
let language: Localization.Language = .hungarian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Új frissítés érhető el")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Később")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ennél a verziónál ne figyelmeztessen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Frissítés")
|
||||
}
|
||||
|
||||
func testIndonesianLocalization() {
|
||||
let language: Localization.Language = .indonesian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Pembaruan Tersedia")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lain kali")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Lewati versi ini")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Perbarui")
|
||||
}
|
||||
|
||||
func testItalianLocalization() {
|
||||
let language: Localization.Language = .italian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aggiornamento disponibile")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La prossima volta")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Salta questa versione")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Aggiorna")
|
||||
}
|
||||
|
||||
func testJapaneseLocalization() {
|
||||
let language: Localization.Language = .japanese
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "アップデートのお知らせ")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "次回")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "このバージョンをスキップ")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "アップデート")
|
||||
}
|
||||
|
||||
func testKoreanLocalization() {
|
||||
let language: Localization.Language = .korean
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "업데이트 가능")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "다음에")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "이 버전 건너뜀")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "업데이트")
|
||||
}
|
||||
|
||||
func testLatvianLocalization() {
|
||||
let language: Localization.Language = .latvian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atjauninājums pieejams")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Nākamreiz")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Izlaist šo versiju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atjaunināt")
|
||||
}
|
||||
|
||||
func testLithuanianLocalization() {
|
||||
let language: Localization.Language = .lithuanian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atnaujinimas")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Kitą kartą")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Praleisti šią versiją")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atnaujinti")
|
||||
}
|
||||
|
||||
func testMalayLocalization() {
|
||||
let language: Localization.Language = .malay
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Versi Terkini")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lain kali")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Langkau versi ini")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Muat turun")
|
||||
}
|
||||
|
||||
func testNorwegianLocalization() {
|
||||
let language: Localization.Language = .norwegian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Oppdatering tilgjengelig")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Neste gang")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Hopp over denne versjonen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Oppdater")
|
||||
}
|
||||
|
||||
func testPersianLocalization() {
|
||||
let language: Localization.Language = .persian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دفعه بعد")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPersianAfghanistanLocalization() {
|
||||
let language: Localization.Language = .persianAfghanistan
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دگر بار")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPersianIranLocalization() {
|
||||
let language: Localization.Language = .persianIran
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "بروزرسانی در دسترس")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "دفعه بعد")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "رد این نسخه")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "بروزرسانی")
|
||||
}
|
||||
|
||||
func testPolishLocalization() {
|
||||
let language: Localization.Language = .polish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Aktualizacja dostępna")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Następnym razem")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Pomiń wersję")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Zaktualizuj")
|
||||
}
|
||||
|
||||
func testPortugueseBrazilLocalization() {
|
||||
let language: Localization.Language = .portugueseBrazil
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Atualização disponível")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ignorar esta versão")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Atualizar")
|
||||
}
|
||||
|
||||
func testPortuguesePortugalLocalization() {
|
||||
let language: Localization.Language = .portuguesePortugal
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Nova actualização disponível")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ignorar esta versão")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Actualizar")
|
||||
}
|
||||
|
||||
func testRomanianLocalization() {
|
||||
let language: Localization.Language = .romanian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Actualizare disponibilă")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Data viitoare")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ignor această versiune")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Actualizare")
|
||||
}
|
||||
|
||||
func testRussianLocalization() {
|
||||
let language: Localization.Language = .russian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Доступно обновление")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "В следующий раз")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Пропустить эту версию")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Обновить")
|
||||
}
|
||||
|
||||
func testSerbianCyrillicLocalization() {
|
||||
let language: Localization.Language = .serbianCyrillic
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Ажурирање доступно")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Следећи пут")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Прескочи ову верзију")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ажурирај")
|
||||
}
|
||||
|
||||
func testSerbianLatinLocalization() {
|
||||
let language: Localization.Language = .serbianLatin
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Ažuriranje dostupno")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Sledeći put")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Preskoči ovu verziju")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Ažuriraj")
|
||||
}
|
||||
|
||||
func testSlovenianLocalization() {
|
||||
let language: Localization.Language = .slovenian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Posodobitev aplikacije")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Naslednjič")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Ne želim")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Namesti")
|
||||
}
|
||||
|
||||
func testSpanishLocalization() {
|
||||
let language: Localization.Language = .spanish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Actualización disponible")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "La próxima vez")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Saltar esta versión")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Actualizar")
|
||||
}
|
||||
|
||||
func testSwedishLocalization() {
|
||||
let language: Localization.Language = .swedish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Tillgänglig uppdatering")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Nästa gång")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Hoppa över den här versionen")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Uppdatera")
|
||||
}
|
||||
|
||||
func testThaiLocalization() {
|
||||
let language: Localization.Language = .thai
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "มีการอัพเดท")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "ไว้คราวหน้า")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "ข้ามเวอร์ชั่นนี้")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "อัพเดท")
|
||||
}
|
||||
|
||||
func testTurkishLocalization() {
|
||||
let language: Localization.Language = .turkish
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Güncelleme Mevcut")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Daha sonra")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Boşver")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Güncelle")
|
||||
}
|
||||
|
||||
func testUkrainianLocalization() {
|
||||
let language: Localization.Language = .ukrainian
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Доступне Оновлення")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Наступного разу")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Пропустити версію")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Оновити")
|
||||
}
|
||||
|
||||
func testUrduLocalization() {
|
||||
let language: Localization.Language = .urdu
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "نیا اپڈیٹ")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "اگلی مرتبہ")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "اس ورزن کو چھوڑ دیں")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "اپڈیٹ کریں")
|
||||
}
|
||||
|
||||
func testVietnameseLocalization() {
|
||||
let language: Localization.Language = .vietnamese
|
||||
|
||||
// Update Available
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update Available", andForceLocalization: language), "Cập nhật mới")
|
||||
|
||||
// Next time
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Next time", andForceLocalization: language), "Lần tới")
|
||||
|
||||
// Skip this version
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Skip this version", andForceLocalization: language), "Bỏ qua phiên bản này")
|
||||
|
||||
// Update
|
||||
XCTAssertEqual(Bundle.localizedString(forKey: "Update", andForceLocalization: language), "Cập nhật")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "cocoapods"
|
||||
gem "jazzy", :git => "https://www.github.com/realm/jazzy.git"
|
||||
gem "rubygems-bundler"
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
GIT
|
||||
remote: https://www.github.com/realm/jazzy.git
|
||||
revision: 9b907b33aea078d82975abd590637fa647663805
|
||||
specs:
|
||||
jazzy (0.11.0)
|
||||
cocoapods (~> 1.5)
|
||||
mustache (~> 1.1)
|
||||
open4
|
||||
redcarpet (~> 3.4)
|
||||
rouge (>= 2.0.6, < 4.0)
|
||||
sassc (~> 2.1)
|
||||
sqlite3 (~> 1.3)
|
||||
xcinvoke (~> 0.3.0)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.1)
|
||||
activesupport (4.2.11.1)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
atomos (0.1.3)
|
||||
bundler-unload (1.0.2)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.7.5)
|
||||
activesupport (>= 4.0.2, < 5)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.7.5)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.2.2, < 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.3.1, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
fourflusher (>= 2.3.0, < 3.0)
|
||||
gh_inspector (~> 1.0)
|
||||
molinillo (~> 0.6.6)
|
||||
nap (~> 1.0)
|
||||
ruby-macho (~> 1.4)
|
||||
xcodeproj (>= 1.10.0, < 2.0)
|
||||
cocoapods-core (1.7.5)
|
||||
activesupport (>= 4.0.2, < 6)
|
||||
fuzzy_match (~> 2.0.4)
|
||||
nap (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.4)
|
||||
cocoapods-downloader (1.2.2)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.0)
|
||||
cocoapods-stats (1.1.0)
|
||||
cocoapods-trunk (1.4.0)
|
||||
nap (>= 0.8, < 2.0)
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.1.0)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.5)
|
||||
escape (0.0.4)
|
||||
executable-hooks (1.6.0)
|
||||
ffi (1.11.1)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
liferaft (0.0.6)
|
||||
minitest (5.11.3)
|
||||
molinillo (0.6.6)
|
||||
mustache (1.1.0)
|
||||
nanaimo (0.2.6)
|
||||
nap (1.1.0)
|
||||
netrc (0.11.0)
|
||||
open4 (1.3.4)
|
||||
redcarpet (3.5.0)
|
||||
rouge (3.10.0)
|
||||
ruby-macho (1.4.0)
|
||||
rubygems-bundler (1.4.5)
|
||||
bundler-unload (>= 1.0.2)
|
||||
executable-hooks (>= 1.5.0)
|
||||
sassc (2.2.0)
|
||||
ffi (~> 1.9)
|
||||
sqlite3 (1.4.1)
|
||||
thread_safe (0.3.6)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
xcinvoke (0.3.0)
|
||||
liferaft (~> 0.0.6)
|
||||
xcodeproj (1.12.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.2.6)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods
|
||||
jazzy!
|
||||
rubygems-bundler
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.2
|
||||
@@ -0,0 +1,8 @@
|
||||
// swift-tools-version:5.1
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Siren",
|
||||
products: [.library(name: "Siren", targets: ["Siren"])],
|
||||
targets: [.target(name: "Siren", path: "Sources")]
|
||||
)
|
||||
@@ -1,189 +1,226 @@
|
||||
# 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://travis-ci.org/ArtSabintsev/Siren)  
|
||||
|
||||
[](https://cocoapods.org/pods/Siren) [](https://github.com/Carthage/Carthage) [](https://github.com/JamitLabs/Accio) [](https://swift.org/package-manager/)
|
||||
|
||||
---
|
||||
|
||||
# Table of Contents
|
||||
- [**Meta**](https://github.com/ArtSabintsev/Siren#meta)
|
||||
- [About](https://github.com/ArtSabintsev/Siren#about)
|
||||
- [Features](https://github.com/ArtSabintsev/Siren#features)
|
||||
- [Screenshots](https://github.com/ArtSabintsev/Siren#screenshots)
|
||||
- [Ports](https://github.com/ArtSabintsev/Siren#ports)
|
||||
- [**Installation and Integration**](https://github.com/ArtSabintsev/Siren#installation-and-integration)
|
||||
- [Installation Instructions](https://github.com/ArtSabintsev/Siren#installation-instructions)
|
||||
- [Implementation Examples](https://github.com/ArtSabintsev/Siren#implementation-examples)
|
||||
- [**Device-Specific Checks**](https://github.com/ArtSabintsev/Siren#device-specific-checks)
|
||||
- [Localization](https://github.com/ArtSabintsev/Siren#localization)
|
||||
- [Device Compatibility](https://github.com/ArtSabintsev/Siren#device-compatibility)
|
||||
- [**Testing**](https://github.com/ArtSabintsev/Siren#testing)
|
||||
- [Testing Siren Locally](https://github.com/ArtSabintsev/Siren#testing-siren-locally)
|
||||
- [Words of Caution](https://github.com/ArtSabintsev/Siren#words-of-caution)
|
||||
- [**App Submission**](https://github.com/ArtSabintsev/Siren#app-submission)
|
||||
- [App Store Review](https://github.com/ArtSabintsev/Siren#app-store-review)
|
||||
- [Phased Releases](https://github.com/ArtSabintsev/Siren#phased-releases)
|
||||
- [**Attribution**](https://github.com/ArtSabintsev/Siren#attribution)
|
||||
- [Special Thanks](https://github.com/ArtSabintsev/Siren#special-thanks)
|
||||
- [Creator](https://github.com/ArtSabintsev/Siren#creator)
|
||||
|
||||
---
|
||||
|
||||
# Meta
|
||||
|
||||
## 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.
|
||||
If a new version is available, a language localized 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 through alternative means, such as a custom user interface.
|
||||
|
||||
- Siren is built to work with the [**Semantic Versioning**](http://semver.org/) system.
|
||||
- Semantic Versioning is a three number versioning system (e.g., 1.0.0)
|
||||
- Siren also supports two-number versioning (e.g., 1.0)
|
||||
- Siren also supports four-number versioning (e.g., 1.0.0.0)
|
||||
- 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).
|
||||
Siren is built to work with the [**Semantic Versioning**](https://semver.org/) system.
|
||||
- Canonical Semantic Versioning uses a three number versioning system (e.g., 1.0.0)
|
||||
- Siren also supports two-number versioning (e.g., 1.0) and four-number versioning (e.g., 1.0.0.0)
|
||||
|
||||
## Features
|
||||
- [x] CocoaPods Support
|
||||
- [x] Support for `UIAlertController` (iOS 8+) and `UIAlertView` (iOS 7)
|
||||
- [x] Localized for 20+ languages (See **Localization** Section)
|
||||
- [x] Three types of alerts (see **Screenshots & Alert Types**)
|
||||
- [x] Optional delegate methods (see **Optional Delegate** section)
|
||||
|
||||
### Current Features
|
||||
- [x] CocoaPods, Carthage, and Swift Package Manager Support (see [Installation Instructions](https://github.com/ArtSabintsev/Siren#installation-instructions))
|
||||
- [x] Three Types of Alerts (see [Screenshots](https://github.com/ArtSabintsev/Siren#screenshots))
|
||||
- [x] Highly Customizable Presentation Rules (see [Implementation Examples](https://github.com/ArtSabintsev/Siren#implementation-examples))
|
||||
- [x] Localized for 40+ Languages (see [Localization](https://github.com/ArtSabintsev/Siren#localization))
|
||||
- [x] Device Compatibility Check (see [Device Compatibility](https://github.com/ArtSabintsev/Siren#device-compatibility))
|
||||
- [x] 100% Documentation Coverage (see https://sabintsev.com/Siren)
|
||||
|
||||
### Future Features
|
||||
A list of future development work can be found on [Siren's Kanban Board](https://github.com/ArtSabintsev/Siren/projects/1).
|
||||
|
||||
---
|
||||
|
||||
## 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 `Rules.AlertType` enum.
|
||||
|
||||
<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">
|
||||
|
||||
## Ports
|
||||
- **Objective-C (iOS)**
|
||||
- [**Harpy**](https://github.com/ArtSabintsev/Harpy)
|
||||
- Siren was ported _from_ Harpy, as Siren and Harpy are maintained by the same developer.
|
||||
- As of December 2018, Harpy has been deprecated in favor of Siren.
|
||||
- **Java (Android)**
|
||||
- [**Egghead Games' Siren library**](https://github.com/eggheadgames/Siren)
|
||||
- The Siren Swift library inspired the Java library.
|
||||
- **React Native (iOS)**
|
||||
- [**Gant Laborde's Siren library**](https://github.com/GantMan/react-native-siren)
|
||||
- The Siren Swift library inspired the React Native library.
|
||||
|
||||
---
|
||||
|
||||
# Installation and Integration
|
||||
|
||||
## Installation Instructions
|
||||
|
||||
### CocoaPods Installation
|
||||
| Swift Version | Branch Name | Will Continue to Receive Updates?
|
||||
| ------------- | ------------- | -------------
|
||||
| 5.1 | master | **Yes**
|
||||
| 5.0 | swift5.0 | No
|
||||
| 4.2 | swift4.2 | No
|
||||
| 4.1 | swift4.1 | No
|
||||
| 3.2 | swift3.2 | No
|
||||
| 3.1 | swift3.1 | No
|
||||
| 2.3 | swift2.3 | No
|
||||
|
||||
### CocoaPods
|
||||
```ruby
|
||||
pod 'Siren'
|
||||
pod 'Siren' # Swift 5.1
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift5.0' # Swift 5.0
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift4.2' # Swift 4.2
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift4.1' # Swift 4.1
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift3.2' # Swift 3.2
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift3.1' # Swift 3.1
|
||||
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift2.3' # Swift 2.3
|
||||
```
|
||||
|
||||
- Add `import Siren` to any `.Swift` file that references Siren via a CocoaPods installation.
|
||||
- Only for apps with a minimum deployment target of iOS 8.0 or later
|
||||
|
||||
> 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**.
|
||||
|
||||
### Manual Installation
|
||||
|
||||
1. [Download Siren](//github.com/ArtSabintsev/Siren/archive/master.zip).
|
||||
2. Copy the `Siren` folder into your project.
|
||||
|
||||
## Setup
|
||||
|
||||
Here's some commented sample code. Adapt this to meet your app's needs.
|
||||
|
||||
```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
|
||||
|
||||
// Required: Your app's iTunes App Store ID
|
||||
siren.appID = <#Your_App_ID#>
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
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(.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(.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 Revision, 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:
|
||||
|
||||
### Carthage
|
||||
```swift
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
|
||||
{
|
||||
...
|
||||
siren.delegate = self
|
||||
siren.alertType = .None
|
||||
...
|
||||
}
|
||||
github "ArtSabintsev/Siren" // Swift 5.0
|
||||
github "ArtSabintsev/Siren" "swift5.0" // Swift 5.0
|
||||
github "ArtSabintsev/Siren" "swift4.2" // Swift 4.2
|
||||
github "ArtSabintsev/Siren" "swift4.1" // Swift 4.1
|
||||
github "ArtSabintsev/Siren" "swift3.2" // Swift 3.2
|
||||
github "ArtSabintsev/Siren" "swift3.1" // Swift 3.1
|
||||
github "ArtSabintsev/Siren" "swift2.3" // Swift 2.3
|
||||
```
|
||||
|
||||
extension AppDelegate: SirenDelegate
|
||||
{
|
||||
// Returns a localized message to this delegate method upon performing a successful version check
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
println("\(message)")
|
||||
### Swift Package Manager
|
||||
```swift
|
||||
.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 5)
|
||||
```
|
||||
|
||||
## Implementation Examples
|
||||
Implementing Siren is as easy as adding two lines of code to your app in **either** `AppDelegate.swift` or `SceneDelegate.swift`:
|
||||
|
||||
### AppDelegate.swift Example
|
||||
```swift
|
||||
import Siren // Line 1
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
Siren.shared.wail() // Line 2
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Siren will call the `sirenDidDetectNewVersionWithoutAlert(message: String)` delegate method, passing a localized, suggested update string suitable for display. Implement this method to display your own messaging, optionally using `message`.
|
||||
|
||||
## Differentiated Alerts for Revision, Patch, Minor, and Major Updates
|
||||
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:
|
||||
|
||||
### SceneDelegate.swift Example
|
||||
```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#>
|
||||
```
|
||||
import Siren // Line 1
|
||||
import UIKit
|
||||
|
||||
## Optional Delegate and Delegate Methods
|
||||
Five delegate methods allow you to handle or track the user's behavior:
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
``` 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
|
||||
var window: UIWindow?
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
Siren.shared.wail() // Line 2
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Force Localization
|
||||
Harpy is localized for Arabic, Armenian, Basque, Chinese (Simplified), Chinese (Traditional), Danish, Dutch, English, Estonian, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Polish, Portuguese (Brazil), Portuguese (Portugal), Russian, Slovenian, Swedish, Spanish, Thai, and Turkish.
|
||||
Siren also has plenty of customization options. All examples can be found in the Example Project's [**AppDelegate**](https://github.com/ArtSabintsev/Siren/blob/master/Example/Example/AppDelegate.swift) file. Uncomment the example you'd like to test.
|
||||
|
||||
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:
|
||||
# Device-Specific Checks
|
||||
|
||||
## Localization
|
||||
Siren is localized for the following languages:
|
||||
|
||||
Arabic, Armenian, Basque, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian (Bokmål), Persian (Afghanistan, Iran, Persian), Polish, Portuguese (Brazil and Portugal), Romanian, Russian, Serbian (Cyrillic and Latin), Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Urdu, Vietnamese
|
||||
|
||||
If your user's device is set to one of the supported locales, an update message will appear in that language. If a locale is not supported, than the message will appear in English.
|
||||
|
||||
You may want the update dialog to *always* appear in a certain language, ignoring the user's device-specific setting. You can enable it like so:
|
||||
|
||||
```swift
|
||||
Siren.sharedInstance.forceLanguageLocalization = SirenLanguageType.<#SirenLanguageType_Enum_Value#>
|
||||
// In this example, we force the `Russian` language.
|
||||
Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian)
|
||||
```
|
||||
## 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, use the **AppID** for the iTunes Connect App (*376771144*), or any other app, and temporarily change the version string in `.xcodeproj` to an older version than the one that's currently available in the App Store.
|
||||
## 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 11 installed on their device, but the app update requires iOS 12, an alert will not be shown. This takes care of the *false positive* case regarding app updating.
|
||||
|
||||
For your convenience, you may turn on `printn()` debugging statements by setting `self.debugEnabled = true` before calling the `checkVersion()` method.
|
||||
---
|
||||
|
||||
## App Store Submissions
|
||||
# Testing
|
||||
|
||||
## Testing Siren Locally
|
||||
Temporarily change the version string in Xcode (within the `.xcodeproj` file) to an older version than the one that's currently available in the App Store. Afterwards, build and run your app, and you should see the alert.
|
||||
|
||||
If you currently don't have an app in the store, change your bundleID to one that is already in the store. In the sample app packaged with this library, we use the [App Store Connect](https://itunes.apple.com/app/id1234793120) app's bundleID: `com.apple.AppStoreConnect`.
|
||||
|
||||
## 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 released, while no new binary is made available for download via the App Store. It is for this reason that Siren will, by default, wait 1 day (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`.
|
||||
|
||||
---
|
||||
|
||||
# App Submission
|
||||
|
||||
## App Store Review
|
||||
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
|
||||
[Arthur Ariel Sabintsev](http://www.sabintsev.com/) & [Aaron Brager](http://twitter.com/getaaron)
|
||||
## Phased Releases
|
||||
In 2017, Apple announced the [ability to rollout app updates gradually (a.k.a. Phased Releases)](https://itunespartner.apple.com/en/apps/faq/Managing%20Your%20Apps_Submission%20Process). Siren will continue to work as it has in the past, presenting an update modal to _all_ users. If you opt-in to a phased rollout for a specific version, you have a few choices:
|
||||
|
||||
- You can leave Siren configured as normal. Phased rollout will continue to auto-update apps. Since all users can still manually update your app directly from the App Store, Siren will ignore the phased rollout and will prompt users to update.
|
||||
- You can set `showAlertAfterCurrentVersionHasBeenReleasedForDays` to `7`, and Siren will not prompt any users until the latest version is 7 days old, after the phased rollout is complete.
|
||||
- You can remotely disable Siren until the rollout is done using your own API / backend logic.
|
||||
|
||||
---
|
||||
|
||||
# Attribution
|
||||
|
||||
## Special Thanks
|
||||
A massive shout-out and thank you goes to the following folks:
|
||||
|
||||
- [Aaron Brager](https://twitter.com/@getaaron) for motivating me and assisting me in building the initial proof-of-concept of Siren (based on [Harpy](https:github.com/ArtSabintsev/Harpy)) back in 2015. Without him, Siren may never have been built.
|
||||
- All of [Harpy's Contributors](https://github.com/ArtSabintsev/Harpy/graphs/contributors) for helping building the feature set from 2012-2015 that was used as the basis for the first version of Siren.
|
||||
- All of [Siren's Contributors](https://github.com/ArtSabintsev/Siren/graphs/contributors) for helping make Siren as powerful and bug-free as it currently is today.
|
||||
|
||||
## Creator
|
||||
[Arthur Ariel Sabintsev](http://www.sabintsev.com/)
|
||||
|
||||
@@ -1,309 +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 = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0700;
|
||||
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;
|
||||
ENABLE_TESTABILITY = 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 = 8.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.sabintsev.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
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 = 8.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.sabintsev.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
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,79 +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)
|
||||
|
||||
// Optional
|
||||
siren.delegate = self
|
||||
|
||||
// Optional
|
||||
siren.debugEnabled = true;
|
||||
|
||||
// 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 Spanish. Siren supports many other languages, not just English and Spanish.
|
||||
// siren.forceLanguageLocalization = .Spanish
|
||||
|
||||
// Required
|
||||
siren.checkVersion(.Immediately)
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate: SirenDelegate
|
||||
{
|
||||
func sirenDidShowUpdateDialog() {
|
||||
print("sirenDidShowUpdateDialog")
|
||||
}
|
||||
|
||||
func sirenUserDidCancel() {
|
||||
print("sirenUserDidCancel")
|
||||
}
|
||||
|
||||
func sirenUserDidSkipVersion() {
|
||||
print("sirenUserDidSkipVersion")
|
||||
}
|
||||
|
||||
func sirenUserDidLaunchAppStore() {
|
||||
print("sirenUserDidLaunchAppStore")
|
||||
}
|
||||
|
||||
/**
|
||||
This delegate method is only hit when alertType is initialized to .None
|
||||
*/
|
||||
func sirenDidDetectNewVersionWithoutAlert(message: String) {
|
||||
print("\(message)")
|
||||
}
|
||||
}
|
||||
+14
-14
@@ -1,23 +1,23 @@
|
||||
Pod::Spec.new do |s|
|
||||
# Version
|
||||
s.version = "5.2.2"
|
||||
s.swift_version = "5.1"
|
||||
|
||||
# Meta
|
||||
s.name = "Siren"
|
||||
s.version = "0.6.2"
|
||||
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 UIAlertController 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.
|
||||
DESC
|
||||
|
||||
s.summary = "Notify users that a new version of your iOS app is available, and prompt them with the App Store link."
|
||||
s.homepage = "https://github.com/ArtSabintsev/Siren"
|
||||
s.license = "MIT"
|
||||
s.authors = { "Arthur Ariel Sabintsev" => "arthur@sabintsev.com", "Aaron Brager" => "getaaron@gmail.com" }
|
||||
s.authors = { "Arthur Ariel Sabintsev" => "arthur@sabintsev.com" }
|
||||
s.description = <<-DESC
|
||||
Notify your users when a new version of your iOS app is available, and prompt them with the App Store link.
|
||||
DESC
|
||||
|
||||
# Compatibility & Sources
|
||||
s.platform = :ios, "8.0"
|
||||
s.source = { :git => "https://github.com/ArtSabintsev/Siren.git", :tag => s.version.to_s }
|
||||
s.source_files = 'Siren/Siren.swift'
|
||||
s.resources = 'Siren/Siren.bundle'
|
||||
s.source_files = 'Sources/**/*.swift'
|
||||
s.resources = 'Sources/Siren.bundle'
|
||||
s.requires_arc = true
|
||||
|
||||
end
|
||||
|
||||
Binary file not shown.
@@ -1,603 +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 public 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()
|
||||
|
||||
*/
|
||||
public enum SirenLanguageType: String {
|
||||
case Arabic = "ar"
|
||||
case Armenian = "hy"
|
||||
case Basque = "eu"
|
||||
case ChineseSimplified = "zh-Hans"
|
||||
case ChineseTraditional = "zh-Hant"
|
||||
case Danish = "da"
|
||||
case Dutch = "nl"
|
||||
case English = "en"
|
||||
case Estonian = "et"
|
||||
case French = "fr"
|
||||
case Hebrew = "he"
|
||||
case Hungarian = "hu"
|
||||
case German = "de"
|
||||
case Italian = "it"
|
||||
case Japanese = "ja"
|
||||
case Korean = "ko"
|
||||
case Latvian = "lv"
|
||||
case Lithuanian = "lt"
|
||||
case Malay = "ms"
|
||||
case Polish = "pl"
|
||||
case PortugueseBrazil = "pt"
|
||||
case PortuguesePortugal = "pt-PT"
|
||||
case Russian = "ru"
|
||||
case Slovenian = "sl"
|
||||
case Spanish = "es"
|
||||
case Swedish = "sv"
|
||||
case Thai = "th"
|
||||
case Turkish = "tr"
|
||||
}
|
||||
|
||||
/**
|
||||
Siren-specific NSUserDefault Keys
|
||||
*/
|
||||
private enum SirenUserDefaults: String {
|
||||
case StoredVersionCheckDate // NSUserDefault key that stores the timestamp of the last version check
|
||||
case StoredSkippedVersion // NSUserDefault key that stores the version that a user decided to skip
|
||||
}
|
||||
|
||||
// MARK: Siren
|
||||
/**
|
||||
The Siren Class.
|
||||
|
||||
A singleton that is initialized using the sharedInstance() method.
|
||||
*/
|
||||
public class Siren: NSObject {
|
||||
|
||||
// MARK: Constants
|
||||
// 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)
|
||||
|
||||
*/
|
||||
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
|
||||
|
||||
// Alert Vars
|
||||
/**
|
||||
Determines the type of alert that should be shown.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
public var alertType = SirenAlertType.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 SirenAlertType.Option.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
public var majorUpdateAlertType = SirenAlertType.Option
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for minor version updates: a.B.c
|
||||
|
||||
Defaults to SirenAlertType.Option.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
public var minorUpdateAlertType = SirenAlertType.Option
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for minor patch updates: a.b.C
|
||||
|
||||
Defaults to SirenAlertType.Option.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
public var patchUpdateAlertType = SirenAlertType.Option
|
||||
|
||||
/**
|
||||
Determines the type of alert that should be shown for revision updates: a.b.c.D
|
||||
|
||||
Defaults to SirenAlertType.Option.
|
||||
|
||||
See the SirenAlertType enum for full details.
|
||||
*/
|
||||
public var revisionUpdateAlertType = SirenAlertType.Option
|
||||
|
||||
// Required Vars
|
||||
/**
|
||||
The App Store / iTunes Connect ID for your app.
|
||||
*/
|
||||
public var appID: String?
|
||||
|
||||
// Optional Vars
|
||||
/**
|
||||
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 = (NSBundle.mainBundle().objectForInfoDictionaryKey(kCFBundleNameKey as String) 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.
|
||||
*/
|
||||
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 SirenLanguageType enum for more details.
|
||||
*/
|
||||
public var forceLanguageLocalization: SirenLanguageType?
|
||||
|
||||
/**
|
||||
Overrides the tint color for UIAlertController.
|
||||
*/
|
||||
public var alertControllerTintColor: UIColor?
|
||||
|
||||
// Private
|
||||
private var lastVersionCheckPerformedOnDate: NSDate?
|
||||
private var currentAppStoreVersion: String?
|
||||
private var updaterWindow: UIWindow?
|
||||
|
||||
// MARK: Initialization
|
||||
public class var sharedInstance: Siren {
|
||||
struct Singleton {
|
||||
static let instance = Siren()
|
||||
}
|
||||
|
||||
return Singleton.instance
|
||||
}
|
||||
|
||||
override init() {
|
||||
lastVersionCheckPerformedOnDate = NSUserDefaults.standardUserDefaults().objectForKey(SirenUserDefaults.StoredVersionCheckDate.rawValue) 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.
|
||||
|
||||
- parameter checkType: The frequency in days in which you want a check to be performed. Please refer to the SirenVersionCheckType enum for more details.
|
||||
*/
|
||||
public func checkVersion(checkType: SirenVersionCheckType) {
|
||||
|
||||
guard let _ = appID else {
|
||||
print("[Siren] Please make sure that you have set 'appID' before calling checkVersion.")
|
||||
return
|
||||
}
|
||||
|
||||
if checkType == .Immediately {
|
||||
performVersionCheck()
|
||||
} else {
|
||||
guard let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate else {
|
||||
performVersionCheck()
|
||||
return
|
||||
}
|
||||
|
||||
if daysSinceLastVersionCheckDate(lastVersionCheckPerformedOnDate) >= checkType.rawValue {
|
||||
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 let error = error {
|
||||
if self.debugEnabled {
|
||||
print("[Siren] Error retrieving App Store data as an error was returned: \(error.localizedDescription)")
|
||||
}
|
||||
} else {
|
||||
guard let data = data else {
|
||||
if self.debugEnabled {
|
||||
print("[Siren] Error retrieving App Store data as no data was returned.")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Convert JSON data to Swift Dictionary of type [String: AnyObject]
|
||||
do {
|
||||
let jsonData = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments)
|
||||
|
||||
guard let appData = jsonData as? [String: AnyObject] else {
|
||||
if self.debugEnabled {
|
||||
print("[Siren] Error parsing App Store JSON data.")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), { () -> Void in
|
||||
|
||||
// Print iTunesLookup results from appData
|
||||
if self.debugEnabled {
|
||||
print("[Siren] JSON results: \(appData)")
|
||||
}
|
||||
|
||||
// Process Results (e.g., extract current version on the AppStore)
|
||||
self.processVersionCheckResults(appData)
|
||||
|
||||
})
|
||||
|
||||
} catch let error as NSError {
|
||||
if self.debugEnabled {
|
||||
print("[Siren] Error retrieving App Store data as data was nil: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
task.resume()
|
||||
}
|
||||
|
||||
private func processVersionCheckResults(lookupResults: [String: AnyObject]) {
|
||||
|
||||
// Store version comparison date
|
||||
storeVersionCheckDate()
|
||||
|
||||
guard let results = lookupResults["results"] as? [[String: AnyObject]] else {
|
||||
if debugEnabled {
|
||||
print("[Siren] Error retrieving App Store verson number as there was no data returned")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if results.isEmpty == false { // Conditional that avoids crash when app not in App Store or appID mistyped
|
||||
currentAppStoreVersion = results[0]["version"] as? String
|
||||
guard let _ = currentAppStoreVersion else {
|
||||
if debugEnabled {
|
||||
print("[Siren] Error retrieving App Store verson number as results[0] does not contain a 'version' key")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if isAppStoreVersionNewer() {
|
||||
showAlertIfCurrentAppStoreVersionNotSkipped()
|
||||
} else {
|
||||
if debugEnabled {
|
||||
print("[Siren] App Store version of app is not newer")
|
||||
}
|
||||
}
|
||||
|
||||
} else { // lookupResults does not contain any data as the returned array is empty
|
||||
if debugEnabled {
|
||||
print("[Siren] Error retrieving App Store verson number as results returns an empty array")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Alert
|
||||
private extension Siren {
|
||||
func showAlertIfCurrentAppStoreVersionNotSkipped() {
|
||||
|
||||
alertType = setAlertType()
|
||||
|
||||
guard let previouslySkippedVersion = NSUserDefaults.standardUserDefaults().objectForKey(SirenUserDefaults.StoredSkippedVersion.rawValue) as? String else {
|
||||
showAlert()
|
||||
return
|
||||
}
|
||||
|
||||
if let currentAppStoreVersion = currentAppStoreVersion {
|
||||
if currentAppStoreVersion != previouslySkippedVersion {
|
||||
showAlert()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func showAlert() {
|
||||
|
||||
let updateAvailableMessage = NSBundle().localizedString("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?(newVersionMessage)
|
||||
}
|
||||
|
||||
if alertType != .None {
|
||||
alertController.show()
|
||||
delegate?.sirenDidShowUpdateDialog?()
|
||||
}
|
||||
}
|
||||
|
||||
func updateAlertAction() -> UIAlertAction {
|
||||
let title = localizedUpdateButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .Default) { (alert: UIAlertAction) -> Void in
|
||||
self.hideWindow()
|
||||
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.hideWindow()
|
||||
self.delegate?.sirenUserDidCancel?()
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func skipAlertAction() -> UIAlertAction {
|
||||
let title = localizedSkipButtonTitle()
|
||||
let action = UIAlertAction(title: title, style: .Default) { (alert: UIAlertAction) -> Void in
|
||||
if let currentAppStoreVersion = self.currentAppStoreVersion {
|
||||
NSUserDefaults.standardUserDefaults().setObject(currentAppStoreVersion, forKey: SirenUserDefaults.StoredSkippedVersion.rawValue)
|
||||
NSUserDefaults.standardUserDefaults().synchronize()
|
||||
}
|
||||
self.hideWindow()
|
||||
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 {
|
||||
print("[Siren] iTunes Lookup URL: \(storeURLString)")
|
||||
}
|
||||
|
||||
return NSURL(string: storeURLString)!
|
||||
}
|
||||
|
||||
func daysSinceLastVersionCheckDate(lastVersionCheckPerformedOnDate: NSDate) -> Int {
|
||||
let calendar = NSCalendar.currentCalendar()
|
||||
let components = calendar.components(.Day, fromDate: NSDate(), toDate: lastVersionCheckPerformedOnDate, options: [])
|
||||
return components.day
|
||||
}
|
||||
|
||||
func isAppStoreVersionNewer() -> Bool {
|
||||
|
||||
var newVersionExists = false
|
||||
|
||||
if let currentInstalledVersion = currentInstalledVersion, currentAppStoreVersion = currentAppStoreVersion {
|
||||
if (currentInstalledVersion.compare(currentAppStoreVersion, options: .NumericSearch) == NSComparisonResult.OrderedAscending) {
|
||||
newVersionExists = true
|
||||
}
|
||||
}
|
||||
|
||||
return newVersionExists
|
||||
}
|
||||
|
||||
func storeVersionCheckDate() {
|
||||
lastVersionCheckPerformedOnDate = NSDate()
|
||||
if let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate {
|
||||
NSUserDefaults.standardUserDefaults().setObject(lastVersionCheckPerformedOnDate, forKey: SirenUserDefaults.StoredVersionCheckDate.rawValue)
|
||||
NSUserDefaults.standardUserDefaults().synchronize()
|
||||
}
|
||||
}
|
||||
|
||||
func setAlertType() -> SirenAlertType {
|
||||
|
||||
guard let currentInstalledVersion = currentInstalledVersion, 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}
|
||||
|
||||
if 2...4 ~= oldVersion.count && oldVersion.count == newVersion.count {
|
||||
if newVersion[0] > oldVersion[0] { // A.b.c.d
|
||||
alertType = majorUpdateAlertType
|
||||
} else if newVersion[1] > oldVersion[1] { // a.B.c.d
|
||||
alertType = minorUpdateAlertType
|
||||
} else if newVersion.count > 2 && newVersion[2] > oldVersion[2] { // a.b.C.d
|
||||
alertType = patchUpdateAlertType
|
||||
} else if newVersion.count > 3 && newVersion[3] > oldVersion[3] { // a.b.c.D
|
||||
alertType = revisionUpdateAlertType
|
||||
}
|
||||
}
|
||||
|
||||
return alertType
|
||||
}
|
||||
|
||||
func hideWindow() {
|
||||
if let updaterWindow = updaterWindow {
|
||||
updaterWindow.hidden = true
|
||||
self.updaterWindow = nil
|
||||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
func launchAppStore() {
|
||||
let iTunesString = "https://itunes.apple.com/app/id\(appID!)"
|
||||
let iTunesURL = NSURL(string: iTunesString)
|
||||
UIApplication.sharedApplication().openURL(iTunesURL!)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UIAlertController
|
||||
private extension UIAlertController {
|
||||
func show() {
|
||||
let window = UIWindow(frame: UIScreen.mainScreen().bounds)
|
||||
window.rootViewController = UIViewController()
|
||||
window.windowLevel = UIWindowLevelAlert + 1
|
||||
|
||||
Siren.sharedInstance.updaterWindow = window
|
||||
|
||||
window.makeKeyAndVisible()
|
||||
window.rootViewController!.presentViewController(self, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: String Localization
|
||||
private extension Siren {
|
||||
func localizedNewVersionMessage() -> String {
|
||||
|
||||
let newVersionMessageToLocalize = "A new version of %@ is available. Please update to version %@ now."
|
||||
let newVersionMessage = NSBundle().localizedString(newVersionMessageToLocalize, forceLanguageLocalization: forceLanguageLocalization)
|
||||
|
||||
guard let currentAppStoreVersion = currentAppStoreVersion else {
|
||||
return String(format: newVersionMessage, appName, "Unknown")
|
||||
}
|
||||
|
||||
return String(format: newVersionMessage, appName, currentAppStoreVersion)
|
||||
}
|
||||
|
||||
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(forClass: Siren.self).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)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// BundleExtension.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/17/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// `Bundle` Extension for Siren.
|
||||
extension Bundle {
|
||||
/// Constants used in the `Bundle` extension.
|
||||
struct Constants {
|
||||
/// Constant for the `.bundle` file extension.
|
||||
static let bundleExtension = "bundle"
|
||||
/// Constant for `CFBundleDisplayName`.
|
||||
static let displayName = "CFBundleDisplayName"
|
||||
/// Constant for the default US English localization.
|
||||
static let englishLocalization = "en"
|
||||
/// Constant for the project file extension.
|
||||
static let projectExtension = "lproj"
|
||||
/// Constant for `CFBundleShortVersionString`.
|
||||
static let shortVersionString = "CFBundleShortVersionString"
|
||||
/// Constant for the localization table.
|
||||
static let table = "SirenLocalizable"
|
||||
}
|
||||
|
||||
/// Fetches the current version of the app.
|
||||
///
|
||||
/// - Returns: The current installed version of the app.
|
||||
final class func version() -> String? {
|
||||
return Bundle.main.object(forInfoDictionaryKey: Constants.shortVersionString) as? String
|
||||
}
|
||||
|
||||
/// Returns the localized string for a given default string.
|
||||
///
|
||||
/// By default, the English language localization is used.
|
||||
/// If the device's localization is set to another locale, that local's language is used if it's supported by Siren.
|
||||
/// If `forcedLanguage` is set to `true`, the chosen language is shown for all devices, irrespective of their device's localization.
|
||||
///
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - key: The default string used to search the localization table for a specific translation.
|
||||
/// - forcedLanguage: Returns
|
||||
/// - Returns: The localized string for a given key.
|
||||
final class func localizedString(forKey key: String, andForceLocalization forcedLanguage: Localization.Language?) -> String {
|
||||
guard var path = sirenBundlePath() else {
|
||||
return key
|
||||
}
|
||||
|
||||
if let deviceLangauge = deviceLanguage(),
|
||||
let devicePath = sirenForcedBundlePath(forceLanguageLocalization: deviceLangauge) {
|
||||
path = devicePath
|
||||
}
|
||||
|
||||
if let forcedLanguage = forcedLanguage,
|
||||
let forcedPath = sirenForcedBundlePath(forceLanguageLocalization: forcedLanguage) {
|
||||
path = forcedPath
|
||||
}
|
||||
|
||||
return Bundle(path: path)?.localizedString(forKey: key, value: key, table: Constants.table) ?? key
|
||||
}
|
||||
|
||||
/// The appropriate name for the app to be displayed in the update alert.
|
||||
///
|
||||
/// Siren checks `CFBundleDisplayName` first. It then falls back to
|
||||
/// to `kCFBundleNameKey` and ultimately to an empty string
|
||||
/// if the aforementioned values are nil.
|
||||
///
|
||||
/// - Returns: The name of the app.
|
||||
final class func bestMatchingAppName() -> String {
|
||||
let bundleDisplayName = Bundle.main.object(forInfoDictionaryKey: Constants.displayName) as? String
|
||||
let bundleName = Bundle.main.object(forInfoDictionaryKey: kCFBundleNameKey as String) as? String
|
||||
|
||||
return bundleDisplayName ?? bundleName ?? ""
|
||||
}
|
||||
}
|
||||
|
||||
private extension Bundle {
|
||||
/// The path to Siren's localization `Bundle`.
|
||||
///
|
||||
/// - Returns: The bundle's path or `nil`.
|
||||
final class func sirenBundlePath() -> String? {
|
||||
return Bundle(for: Siren.self).path(forResource: "\(Siren.self)", ofType: Constants.bundleExtension)
|
||||
}
|
||||
|
||||
/// The path for a particular language localizationin Siren's localization `Bundle`.
|
||||
///
|
||||
/// - Parameter forceLanguageLocalization: The language localization that should be searched for in Siren's localization `bundle`.
|
||||
/// - Returns: The path to the forced language localization.
|
||||
final class func sirenForcedBundlePath(forceLanguageLocalization: Localization.Language) -> String? {
|
||||
guard let path = sirenBundlePath() else { return nil }
|
||||
let name = forceLanguageLocalization.rawValue
|
||||
|
||||
return Bundle(path: path)?.path(forResource: name, ofType: Constants.projectExtension)
|
||||
}
|
||||
|
||||
/// The user's preferred language based on their device's localization.
|
||||
///
|
||||
/// - Returns: The user's preferred language.
|
||||
final class func deviceLanguage() -> Localization.Language? {
|
||||
guard let preferredLocalization = Bundle.main.preferredLocalizations.first,
|
||||
preferredLocalization != Constants.englishLocalization,
|
||||
let preferredLanguage = Localization.Language(rawValue: preferredLocalization) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return preferredLanguage
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// DateExtension.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/21/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// `Date` Extension for Siren.
|
||||
extension Date {
|
||||
/// The amount of days passed from a specific source date.
|
||||
///
|
||||
/// - Parameter date: The source date.
|
||||
/// - Returns: The amount of days passed since the source date.
|
||||
static func days(since date: Date) -> Int {
|
||||
let calendar = Calendar.current
|
||||
let components = calendar.dateComponents([.day], from: date, to: Date())
|
||||
return components.day ?? 0
|
||||
}
|
||||
|
||||
/// The amount of days passed from a specific source date string.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - dateString: The source date string.
|
||||
/// - Returns: The amount of days passed since the source date.
|
||||
static func days(since dateString: String) -> Int? {
|
||||
let dateformatter = DateFormatter()
|
||||
dateformatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
dateformatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'"
|
||||
dateformatter.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
|
||||
guard let date = dateformatter.date(from: dateString) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return days(since: date)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// UIAlertControllerExtension.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/17/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
// `UIAlertController` Extension for Siren.
|
||||
extension UIAlertController {
|
||||
/// Presents Siren's `UIAlertController` in a new `UIWindow`.
|
||||
///
|
||||
/// - Parameter window: The `UIWindow` that _should_ reference Siren's `UIAlertController`.
|
||||
func show(window: UIWindow) {
|
||||
guard !self.isBeingPresented else { return }
|
||||
window.makeKeyAndVisible()
|
||||
window.rootViewController?.present(self, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
/// Hides Siren's `UIAlertController` within a given window.
|
||||
///
|
||||
/// - Parameter window: The `UIWindow` that references Siren's `UIAlertController`.
|
||||
func hide(window: UIWindow) {
|
||||
window.isHidden = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// UserDefaultsExtension.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 9/25/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// `UserDefaults` Extension for Siren.
|
||||
extension UserDefaults {
|
||||
/// Siren-specific `UserDefaults` Keys
|
||||
private enum SirenKeys: String {
|
||||
/// Key that notifies Siren to perform a version check and present
|
||||
/// the Siren alert the next time the user launches the app.
|
||||
case PerformVersionCheckOnSubsequentLaunch
|
||||
|
||||
/// Key that stores the timestamp of the last version check.
|
||||
case StoredVersionCheckDate
|
||||
|
||||
/// Key that stores the version that a user decided to skip.
|
||||
case StoredSkippedVersion
|
||||
}
|
||||
|
||||
/// Sets and Gets a `UserDefault` around storing a version that the user wants to skip updating.
|
||||
static var storedSkippedVersion: String? {
|
||||
get {
|
||||
return standard.string(forKey: SirenKeys.StoredSkippedVersion.rawValue)
|
||||
} set {
|
||||
standard.set(newValue, forKey: SirenKeys.StoredSkippedVersion.rawValue)
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets and Gets a `UserDefault` around the last time the user was presented a version update alert.
|
||||
static var alertPresentationDate: Date? {
|
||||
get {
|
||||
return standard.object(forKey: SirenKeys.StoredVersionCheckDate.rawValue) as? Date
|
||||
} set {
|
||||
standard.set(newValue, forKey: SirenKeys.StoredVersionCheckDate.rawValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
//
|
||||
// APIManager.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 11/24/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// APIManager for Siren
|
||||
public struct APIManager {
|
||||
/// Constants used in the `APIManager`.
|
||||
private struct Constants {
|
||||
/// Constant for the `bundleId` parameter in the iTunes Lookup API request.
|
||||
static let bundleID = "bundleId"
|
||||
/// Constant for the `country` parameter in the iTunes Lookup API request.
|
||||
static let country = "country"
|
||||
}
|
||||
|
||||
/// Return results or errors obtained from performing a version check with Siren.
|
||||
typealias CompletionHandler = (Result<APIModel, KnownError>) -> Void
|
||||
|
||||
/// The region or country of an App Store in which the app is available.
|
||||
/// By default, all version check requests are performed against the US App Store.
|
||||
/// If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.
|
||||
///
|
||||
/// [List of country codes](https://help.apple.com/app-store-connect/#/dev997f9cf7c)
|
||||
///
|
||||
let countryCode: String?
|
||||
|
||||
/// Initializes `APIManager` to the region or country of an App Store in which the app is available.
|
||||
/// By default, all version check requests are performed against the US App Store.
|
||||
/// If the app is not available in the US App Store, set it to the identifier of at least one App Store region within which it is available.
|
||||
///
|
||||
/// [List of country codes](https://help.apple.com/app-store-connect/#/dev997f9cf7c)
|
||||
///
|
||||
/// - Parameter countryCode: The country code for the App Store in which the app is availabe. Defaults to nil (e.g., the US App Store)
|
||||
public init(countryCode: String? = nil) {
|
||||
self.countryCode = countryCode
|
||||
}
|
||||
|
||||
/// The default `APIManager`.
|
||||
///
|
||||
/// The version check is performed against the US App Store.
|
||||
public static let `default` = APIManager()
|
||||
}
|
||||
|
||||
extension APIManager {
|
||||
/// Creates and performs a URLRequest against the iTunes Lookup API.
|
||||
///
|
||||
/// - Parameter handler: The completion handler for the iTunes Lookup API request.
|
||||
func performVersionCheckRequest(completion handler: CompletionHandler?) {
|
||||
guard Bundle.main.bundleIdentifier != nil else {
|
||||
handler?(.failure(.missingBundleID))
|
||||
return
|
||||
}
|
||||
|
||||
do {
|
||||
let url = try makeITunesURL()
|
||||
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 30)
|
||||
URLSession.shared.dataTask(with: request) { (data, response, error) in
|
||||
URLCache.shared.removeCachedResponse(for: request)
|
||||
self.processVersionCheckResults(withData: data, response: response, error: error, completion: handler)
|
||||
}.resume()
|
||||
} catch {
|
||||
handler?(.failure(.malformedURL))
|
||||
}
|
||||
}
|
||||
|
||||
/// Parses and maps the the results from the iTunes Lookup API request.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - data: The JSON data returned from the request.
|
||||
/// - response: The response metadata returned from the request.
|
||||
/// - error: The error returned from the request.
|
||||
/// - handler: The completion handler to call once the results of the request has been processed.
|
||||
private func processVersionCheckResults(withData data: Data?,
|
||||
response: URLResponse?,
|
||||
error: Error?,
|
||||
completion handler: CompletionHandler?) {
|
||||
if let error = error {
|
||||
handler?(.failure(.appStoreDataRetrievalFailure(underlyingError: error)))
|
||||
} else {
|
||||
guard let data = data else {
|
||||
handler?(.failure(.appStoreDataRetrievalFailure(underlyingError: nil)))
|
||||
return
|
||||
}
|
||||
do {
|
||||
let apiModel = try JSONDecoder().decode(APIModel.self, from: data)
|
||||
|
||||
guard !apiModel.results.isEmpty else {
|
||||
handler?(.failure(.appStoreDataRetrievalEmptyResults))
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
handler?(.success(apiModel))
|
||||
}
|
||||
} catch {
|
||||
handler?(.failure(.appStoreJSONParsingFailure(underlyingError: error)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates the URL that points to the iTunes Lookup API.
|
||||
///
|
||||
/// - Returns: The iTunes Lookup API URL.
|
||||
/// - Throws: An error if the URL cannot be created.
|
||||
private func makeITunesURL() throws -> URL {
|
||||
var components = URLComponents()
|
||||
components.scheme = "https"
|
||||
components.host = "itunes.apple.com"
|
||||
components.path = "/lookup"
|
||||
|
||||
var items: [URLQueryItem] = [URLQueryItem(name: Constants.bundleID, value: Bundle.main.bundleIdentifier)]
|
||||
|
||||
if let countryCode = countryCode {
|
||||
let item = URLQueryItem(name: Constants.country, value: countryCode)
|
||||
items.append(item)
|
||||
}
|
||||
|
||||
components.queryItems = items
|
||||
|
||||
guard let url = components.url, !url.absoluteString.isEmpty else {
|
||||
throw KnownError.malformedURL
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
//
|
||||
// PresentationManager.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 12/6/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
/// PresentationManager for Siren
|
||||
public struct PresentationManager {
|
||||
/// Return results or errors obtained from performing a version check with Siren.
|
||||
typealias CompletionHandler = (AlertAction, String?) -> Void
|
||||
|
||||
/// The localization data structure that will be used to construct localized strings for the update alert.
|
||||
let localization: Localization
|
||||
|
||||
/// The tint color of the `UIAlertController` buttons.
|
||||
let tintColor: UIColor?
|
||||
|
||||
/// The descriptive update message of the `UIAlertController`.
|
||||
let alertMessage: String
|
||||
|
||||
/// The main message of the `UIAlertController`.
|
||||
let alertTitle: String
|
||||
|
||||
/// The "Next time" button text of the `UIAlertController`.
|
||||
let nextTimeButtonTitle: String
|
||||
|
||||
/// The "Skip this version" button text of the `UIAlertController`.
|
||||
let skipButtonTitle: String
|
||||
|
||||
/// The "Update" button text of the `UIAlertController`.
|
||||
let updateButtonTitle: String
|
||||
|
||||
/// The instance of the `UIAlertController` used to present the update alert.
|
||||
var alertController: UIAlertController?
|
||||
|
||||
/// The `UIWindow` instance that presents the `SirenViewController`.
|
||||
private var updaterWindow: UIWindow {
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.windowLevel = UIWindow.Level.alert + 1
|
||||
|
||||
let viewController = SirenViewController()
|
||||
viewController.retainedWindow = window
|
||||
|
||||
window.rootViewController = viewController
|
||||
return window
|
||||
}
|
||||
|
||||
/// `PresentationManager`'s public initializer.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - tintColor: The alert's tintColor. Settings this to `nil` defaults to the system default color.
|
||||
/// - appName: The name of the app (overrides the default/bundled name).
|
||||
/// - alertTitle: The title field of the `UIAlertController`.
|
||||
/// - alertMessage: The `message` field of the `UIAlertController`.
|
||||
/// - nextTimeButtonTitle: The `title` field of the Next Time Button `UIAlertAction`.
|
||||
/// - skipButtonTitle: The `title` field of the Skip Button `UIAlertAction`.
|
||||
/// - updateButtonTitle: The `title` field of the Update Button `UIAlertAction`.
|
||||
/// - forceLanguage: The language the alert to which the alert should be set. If `nil`, it falls back to the device's preferred locale.
|
||||
public init(alertTintColor tintColor: UIColor? = nil,
|
||||
appName: String? = nil,
|
||||
alertTitle: String = AlertConstants.alertTitle,
|
||||
alertMessage: String = AlertConstants.alertMessage,
|
||||
updateButtonTitle: String = AlertConstants.updateButtonTitle,
|
||||
nextTimeButtonTitle: String = AlertConstants.nextTimeButtonTitle,
|
||||
skipButtonTitle: String = AlertConstants.skipButtonTitle,
|
||||
forceLanguageLocalization forceLanguage: Localization.Language? = nil) {
|
||||
self.alertTitle = alertTitle
|
||||
self.alertMessage = alertMessage
|
||||
self.localization = Localization(appName: appName, andForceLanguageLocalization: forceLanguage)
|
||||
self.nextTimeButtonTitle = nextTimeButtonTitle
|
||||
self.updateButtonTitle = updateButtonTitle
|
||||
self.skipButtonTitle = skipButtonTitle
|
||||
self.tintColor = tintColor
|
||||
}
|
||||
|
||||
/// The default `PresentationManager`.
|
||||
///
|
||||
/// By default:
|
||||
/// - There is no tint color (defaults to Apple's system `blue` color.)
|
||||
/// - The name of the app is equal to the name that appears in `Info.plist`.
|
||||
/// - The strings are all set to that of the user's device localization (if supported) or it falls back to English.
|
||||
public static let `default` = PresentationManager()
|
||||
}
|
||||
|
||||
// MARK: - Alert Lifecycle
|
||||
|
||||
extension PresentationManager {
|
||||
|
||||
/// Constructs the localized update alert `UIAlertController` object.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - rules: The rules that are used to define the type of alert that should be presented.
|
||||
/// - currentAppStoreVersion: The current version of the app in the App Store.
|
||||
/// - handler: The completion handler that returns the an `AlertAction` depending on the type of action the end-user took.
|
||||
mutating func presentAlert(withRules rules: Rules,
|
||||
forCurrentAppStoreVersion currentAppStoreVersion: String,
|
||||
completion handler: CompletionHandler?) {
|
||||
UserDefaults.alertPresentationDate = Date()
|
||||
|
||||
// Alert Title
|
||||
let alertTitle: String
|
||||
if self.alertTitle == AlertConstants.alertTitle {
|
||||
alertTitle = localization.alertTitle()
|
||||
} else {
|
||||
alertTitle = self.alertTitle
|
||||
}
|
||||
|
||||
// Alert Message
|
||||
let alertMessage: String
|
||||
if self.alertMessage == AlertConstants.alertMessage {
|
||||
alertMessage = localization.alertMessage(forCurrentAppStoreVersion: currentAppStoreVersion)
|
||||
} else {
|
||||
alertMessage = self.alertMessage
|
||||
}
|
||||
|
||||
alertController = UIAlertController(title: alertTitle,
|
||||
message: alertMessage,
|
||||
preferredStyle: .alert)
|
||||
|
||||
if let tintColor = tintColor {
|
||||
alertController?.view.tintColor = tintColor
|
||||
}
|
||||
|
||||
switch rules.alertType {
|
||||
case .force:
|
||||
alertController?.addAction(updateAlertAction(completion: handler))
|
||||
case .option:
|
||||
alertController?.addAction(nextTimeAlertAction(completion: handler))
|
||||
alertController?.addAction(updateAlertAction(completion: handler))
|
||||
case .skip:
|
||||
alertController?.addAction(updateAlertAction(completion: handler))
|
||||
alertController?.addAction(nextTimeAlertAction(completion: handler))
|
||||
alertController?.addAction(skipAlertAction(forCurrentAppStoreVersion: currentAppStoreVersion, completion: handler))
|
||||
case .none:
|
||||
handler?(.unknown, nil)
|
||||
}
|
||||
|
||||
// If the alertType is .none, an alert will not be presented.
|
||||
// If the `updaterWindow` is not hidden, then an alert is already presented.
|
||||
// The latter prevents `UIAlertController`'s from appearing on top of each other.
|
||||
if rules.alertType != .none, updaterWindow.isHidden {
|
||||
alertController?.show(window: updaterWindow)
|
||||
} else {
|
||||
// This is a safety precaution to avoid multiple windows from presenting on top of each other.
|
||||
cleanUp()
|
||||
}
|
||||
}
|
||||
|
||||
/// Removes the `alertController` from memory.
|
||||
func cleanUp() {
|
||||
alertController?.hide(window: updaterWindow)
|
||||
alertController?.dismiss(animated: true, completion: nil)
|
||||
self.updaterWindow.rootViewController = nil
|
||||
self.updaterWindow.resignKey()
|
||||
self.updaterWindow.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Alert Actions
|
||||
|
||||
private extension PresentationManager {
|
||||
|
||||
/// The `UIAlertAction` that is executed when the `Update` option is selected.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - handler: The completion handler that returns the `.update` option.
|
||||
/// - Returns: The `Update` alert action.
|
||||
func updateAlertAction(completion handler: CompletionHandler?) -> UIAlertAction {
|
||||
let title: String
|
||||
if self.updateButtonTitle == AlertConstants.updateButtonTitle {
|
||||
title = localization.updateButtonTitle()
|
||||
} else {
|
||||
title = self.updateButtonTitle
|
||||
}
|
||||
|
||||
let action = UIAlertAction(title: title, style: .default) { _ in
|
||||
self.cleanUp()
|
||||
handler?(.appStore, nil)
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
/// The `UIAlertAction` that is executed when the `Next time` option is selected.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - handler: The completion handler that returns the `.nextTime` option.
|
||||
/// - Returns: The `Next time` alert action.
|
||||
func nextTimeAlertAction(completion handler: CompletionHandler?) -> UIAlertAction {
|
||||
let title: String
|
||||
if self.nextTimeButtonTitle == AlertConstants.nextTimeButtonTitle {
|
||||
title = localization.nextTimeButtonTitle()
|
||||
} else {
|
||||
title = self.nextTimeButtonTitle
|
||||
}
|
||||
|
||||
let action = UIAlertAction(title: title, style: .default) { _ in
|
||||
self.cleanUp()
|
||||
handler?(.nextTime, nil)
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
/// The `UIAlertAction` that is executed when the `Skip this version` option is selected.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - currentAppStoreVersion: The current version of the app in the App Store.
|
||||
/// - handler: The completion handler that returns the `.skip` option.
|
||||
/// - Returns: The `Skip this version` alert action.
|
||||
func skipAlertAction(forCurrentAppStoreVersion currentAppStoreVersion: String, completion handler: CompletionHandler?) -> UIAlertAction {
|
||||
let title: String
|
||||
if self.skipButtonTitle == AlertConstants.skipButtonTitle {
|
||||
title = localization.skipButtonTitle()
|
||||
} else {
|
||||
title = self.skipButtonTitle
|
||||
}
|
||||
|
||||
let action = UIAlertAction(title: title, style: .default) { _ in
|
||||
self.cleanUp()
|
||||
handler?(.skip, currentAppStoreVersion)
|
||||
return
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
//
|
||||
// RulesManager.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 12/1/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// RulesManager for Siren
|
||||
public struct RulesManager {
|
||||
/// The alert will only show up if the current version has already been released for X days.
|
||||
///
|
||||
/// This value defaults to 1 day (in `RulesManager`'s initializer) to avoid an issue where
|
||||
/// Apple updates the JSON faster than the app binary propogates to the App Store.
|
||||
let releasedForDays: Int
|
||||
|
||||
/// The `Rules` that should be used when the App Store version of the app signifies that it is a **major** version update (A.b.c.d).
|
||||
var majorUpdateRules: Rules
|
||||
|
||||
/// The `Rules` that should be used when the App Store version of the app signifies that it is a **minor** version update (a.B.c.d).
|
||||
var minorUpdateRules: Rules
|
||||
|
||||
/// The `Rules` that should be used when the App Store version of the app signifies that it is a **patch** version update (a.b.C.d).
|
||||
var patchUpdateRules: Rules
|
||||
|
||||
/// The `Rules` that should be used when the App Store version of the app signifies that it is a **revision** version update (a.b.c.D).
|
||||
var revisionUpdateRules: Rules
|
||||
|
||||
/// Initializer that sets update-specific `Rules` for all updates (e.g., major, minor, patch, revision).
|
||||
/// This means that each of the four update types can have their own specific update rules.
|
||||
///
|
||||
/// By default, the `releasedForDays` parameter delays the update alert from being presented for _1 day_
|
||||
/// to avoid an issue where the _iTunes Lookup_ API response is updated faster than the time it takes for the binary
|
||||
/// to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the _1 day_ delay.
|
||||
///
|
||||
/// - Warning: Setting `releasedForDays` to _0 days_ causes the alert to appear right away, even if the binary isn't available.
|
||||
/// If this value is set to _0 days_, and an `AlertType` of type `.force` is set, it will cause your app to infinitely send the
|
||||
/// end-user to the App Store to download a version that's not there and lock them out of your application until the binary is
|
||||
/// is available to be downloaded.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - rules: The rules that should be set for all version updates.
|
||||
/// - releasedForDays: The amount of time (in days) that the app should delay before presenting the user
|
||||
public init(majorUpdateRules: Rules = .default,
|
||||
minorUpdateRules: Rules = .default,
|
||||
patchUpdateRules: Rules = .default,
|
||||
revisionUpdateRules: Rules = .default,
|
||||
showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1) {
|
||||
self.majorUpdateRules = majorUpdateRules
|
||||
self.minorUpdateRules = minorUpdateRules
|
||||
self.patchUpdateRules = patchUpdateRules
|
||||
self.revisionUpdateRules = revisionUpdateRules
|
||||
self.releasedForDays = releasedForDays
|
||||
}
|
||||
|
||||
/// Initializer that sets the same update `Rules` for all types of updates (e.g., major, minor, patch, revision).
|
||||
/// This means that all four update types will use the same presentation rules.
|
||||
///
|
||||
/// By default, the `releasedForDays` parameter delays the update alert from being presented for _1 day_
|
||||
/// to avoid an issue where the _iTunes Lookup_ API response is updated faster than the time it takes for the binary
|
||||
/// to become available on App Store CDNs across all regions. Usually it takes 6-24 hours, hence the _1 day_ delay.
|
||||
///
|
||||
/// - Warning: Setting `releasedForDays` to _0 days_ causes the alert to appear right away, even if the binary isn't available.
|
||||
/// If this value is set to _0 days_, and an `AlertType` of type `.force` is set, it will cause your app to infinitely send the
|
||||
/// end-user to the App Store to download a version that's not there and lock them out of your application until the binary is
|
||||
/// is available to be downloaded.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - rules: The rules that should be set for all version updates.
|
||||
/// - releasedForDays: The amount of time (in days) that the app should delay before presenting the user
|
||||
public init(globalRules rules: Rules = .default,
|
||||
showAlertAfterCurrentVersionHasBeenReleasedForDays releasedForDays: Int = 1) {
|
||||
self.init(majorUpdateRules: rules,
|
||||
minorUpdateRules: rules,
|
||||
patchUpdateRules: rules,
|
||||
revisionUpdateRules: rules,
|
||||
showAlertAfterCurrentVersionHasBeenReleasedForDays: releasedForDays)
|
||||
}
|
||||
|
||||
/// Returns the appropriate update rules based on the type of version that is returned from the API.
|
||||
///
|
||||
/// - Parameters: type: The type of app update.
|
||||
/// - Throws: The `noUpdateAvailable` error since this is the only way a valie of `unknown` can occur.
|
||||
/// - Returns: The appropriate rule based on the type of app update that is returned by the API.
|
||||
func loadRulesForUpdateType(_ type: UpdateType) throws -> Rules {
|
||||
switch type {
|
||||
case .major: return majorUpdateRules
|
||||
case .minor: return minorUpdateRules
|
||||
case .patch: return patchUpdateRules
|
||||
case .revision: return revisionUpdateRules
|
||||
case .unknown: throw KnownError.noUpdateAvailable
|
||||
}
|
||||
}
|
||||
|
||||
/// The default `RulesManager`.
|
||||
///
|
||||
/// By default, the `Rules.default` rule is used for all update typs.
|
||||
public static let `default` = RulesManager(globalRules: .default)
|
||||
}
|
||||
|
||||
// MARK: - RulesManager-related Constants
|
||||
|
||||
extension RulesManager {
|
||||
/// Informs Siren of the type of update that is available so that
|
||||
/// the appropriate ruleset is used to present the update alert.
|
||||
///
|
||||
/// - major: Major release available: A.b.c.d
|
||||
/// - minor: Minor release available: a.B.c.d
|
||||
/// - patch: Patch release available: a.b.C.d
|
||||
/// - revision: Revision release available: a.b.c.D
|
||||
/// - unknown: No information available about the update.
|
||||
public enum UpdateType: String {
|
||||
/// Major release available: A.b.c.d
|
||||
case major
|
||||
/// Minor release available: a.B.c.d
|
||||
case minor
|
||||
/// Patch release available: a.b.C.d
|
||||
case patch
|
||||
/// Revision release available: a.b.c.D
|
||||
case revision
|
||||
/// No information available about the update.
|
||||
case unknown
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// APIModel.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 8/6/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Model representing a selection of results from the iTunes Lookup API.
|
||||
struct APIModel: Decodable {
|
||||
/// Codable Coding Keys for the Top-Level iTunes Lookup API JSON response.
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
/// The results JSON key.
|
||||
case results
|
||||
}
|
||||
|
||||
/// The array of results objects from the iTunes Lookup API.
|
||||
let results: [Results]
|
||||
|
||||
/// The Results object from the the iTunes Lookup API.
|
||||
struct Results: Decodable {
|
||||
/// Codable Coding Keys for the Results array in the iTunes Lookup API JSON response.
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
/// The appID JSON key.
|
||||
case appID = "trackId"
|
||||
/// The current version release date JSON key.
|
||||
case currentVersionReleaseDate
|
||||
/// The minimum device iOS version compatibility JSON key.
|
||||
case minimumOSVersion = "minimumOsVersion"
|
||||
/// The release notes JSON key.
|
||||
case releaseNotes
|
||||
/// The current App Store version JSON key.
|
||||
case version
|
||||
}
|
||||
|
||||
/// The app's App ID.
|
||||
let appID: Int
|
||||
|
||||
/// The release date for the latest version of the app.
|
||||
let currentVersionReleaseDate: String
|
||||
|
||||
/// The minimum version of iOS that the current version of the app requires.
|
||||
let minimumOSVersion: String
|
||||
|
||||
/// The releases notes from the latest version of the app.
|
||||
let releaseNotes: String?
|
||||
|
||||
/// The latest version of the app.
|
||||
let version: String
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// AlertAction.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 12/1/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The `UIAlertController` button that was pressed upon being presented an update alert.
|
||||
public enum AlertAction {
|
||||
/// The user clicked on the `Update` option, which took them to the app's App Store page.
|
||||
case appStore
|
||||
/// The user clicked on the `Next Time` option, which dismissed the alert.
|
||||
case nextTime
|
||||
/// The user clicked on the `Skip this version` option, which dismissed the alert.
|
||||
case skip
|
||||
/// (Default) The user never chose an option. This is returned when an error is thrown by Siren.
|
||||
case unknown
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// AlertConstants.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 12/18/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The default constants used for the update alert's messaging.
|
||||
public struct AlertConstants {
|
||||
/// The text that conveys the message that there is an app update available
|
||||
public static let alertMessage = "A new version of %@ is available. Please update to version %@ now."
|
||||
|
||||
/// The alert title which defaults to *Update Available*.
|
||||
public static let alertTitle = "Update Available"
|
||||
|
||||
/// The button text that conveys the message that the user should be prompted to update next time the app launches.
|
||||
public static let nextTimeButtonTitle = "Next time"
|
||||
|
||||
/// The text that conveys the message that the the user wants to skip this version update.
|
||||
public static let skipButtonTitle = "Skip this version"
|
||||
|
||||
/// The button text that conveys the message that the user would like to update the app right away.
|
||||
public static let updateButtonTitle = "Update"
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
//
|
||||
// Localization.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 9/25/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Localization information and strings for Siren.
|
||||
public struct Localization {
|
||||
/// Determines the available languages in which the update message and alert button titles should appear.
|
||||
///
|
||||
/// By default, the operating system's default lanuage setting is used. However, you can force a specific language
|
||||
/// by setting the forceLanguageLocalization property before calling checkVersion()
|
||||
public enum Language: String {
|
||||
/// Arabic Language Localization
|
||||
case arabic = "ar"
|
||||
/// Armenian Language Localization
|
||||
case armenian = "hy"
|
||||
/// Basque Language Localization
|
||||
case basque = "eu"
|
||||
/// Simplified Chinese Language Localization
|
||||
case chineseSimplified = "zh-Hans"
|
||||
/// Traditional Chinese Localization Localization
|
||||
case chineseTraditional = "zh-Hant"
|
||||
/// Croatian Language Localization
|
||||
case croatian = "hr"
|
||||
/// Czech Language Localization
|
||||
case czech = "cs"
|
||||
/// Danish Language Localization
|
||||
case danish = "da"
|
||||
/// Dutch Language Localization
|
||||
case dutch = "nl"
|
||||
/// English Language Localization
|
||||
case english = "en"
|
||||
/// Estonian Language Localization
|
||||
case estonian = "et"
|
||||
/// Finnish Language Localization
|
||||
case finnish = "fi"
|
||||
/// French Language Localization
|
||||
case french = "fr"
|
||||
/// German Language Localization
|
||||
case german = "de"
|
||||
/// Greek Language Localization
|
||||
case greek = "el"
|
||||
/// Hebrew Language Localization
|
||||
case hebrew = "he"
|
||||
/// Hungarian Language Localization
|
||||
case hungarian = "hu"
|
||||
/// Indonesian Language Localization
|
||||
case indonesian = "id"
|
||||
/// Italian Language Localization
|
||||
case italian = "it"
|
||||
/// Japanese Language Localization
|
||||
case japanese = "ja"
|
||||
/// Korean Language Localization
|
||||
case korean = "ko"
|
||||
/// Latvian Language Localization
|
||||
case latvian = "lv"
|
||||
/// Lithuanian Language Localization
|
||||
case lithuanian = "lt"
|
||||
/// Malay Language Localization
|
||||
case malay = "ms"
|
||||
/// Norwegian Language Localization
|
||||
case norwegian = "nb-NO"
|
||||
/// Persian Language Localization
|
||||
case persian = "fa"
|
||||
/// Persian (Afghanistan) Language Localization
|
||||
case persianAfghanistan = "fa-AF"
|
||||
/// Persian (Iran) Language Localization
|
||||
case persianIran = "fa-IR"
|
||||
/// Polish Language Localization
|
||||
case polish = "pl"
|
||||
/// Brazilian Portuguese Language Localization
|
||||
case portugueseBrazil = "pt"
|
||||
/// Portugal's Portuguese Language Localization
|
||||
case portuguesePortugal = "pt-PT"
|
||||
/// Romanian Language Localization
|
||||
case romanian = "ro"
|
||||
/// Russian Language Localization
|
||||
case russian = "ru"
|
||||
/// Serbian (Cyrillic) Language Localization
|
||||
case serbianCyrillic = "sr-Cyrl"
|
||||
/// Serbian (Latin) Language Localization
|
||||
case serbianLatin = "sr-Latn"
|
||||
/// Slovenian Language Localization
|
||||
case slovenian = "sl"
|
||||
/// Spanish Language Localization
|
||||
case spanish = "es"
|
||||
/// Swedish Language Localization
|
||||
case swedish = "sv"
|
||||
/// Thai Language Localization
|
||||
case thai = "th"
|
||||
/// Turkish Language Localization
|
||||
case turkish = "tr"
|
||||
/// Urdu Language Localization
|
||||
case urdu = "ur"
|
||||
/// Ukranian Language Localization
|
||||
case ukrainian = "uk"
|
||||
/// Vietnamese Language Localization
|
||||
case vietnamese = "vi"
|
||||
}
|
||||
|
||||
/// The name of the app as defined by the `Info.plist`.
|
||||
private var appName: String = Bundle.bestMatchingAppName()
|
||||
|
||||
/// Overrides the default localization of a user's device when presenting the update message and button titles in the alert.
|
||||
///
|
||||
/// See the Siren.Localization.Language enum for more details.
|
||||
private let forceLanguage: Language?
|
||||
|
||||
/// Initializes
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - appName: Overrides the default name of the app. This is optional and defaults to the app that is defined in the `Info.plist`.
|
||||
/// - forceLanguage: The language the alert to which the alert should be set. If `nil`, it falls back to the device's preferred locale.
|
||||
init(appName: String?, andForceLanguageLocalization forceLanguage: Language?) {
|
||||
if let appName = appName {
|
||||
self.appName = appName
|
||||
}
|
||||
|
||||
self.forceLanguage = forceLanguage
|
||||
}
|
||||
|
||||
/// The localized string for the `UIAlertController`'s message field. .
|
||||
///
|
||||
/// - Returns: A localized string for the update message.
|
||||
public func alertMessage(forCurrentAppStoreVersion currentAppStoreVersion: String) -> String {
|
||||
let message = Bundle.localizedString(forKey: AlertConstants.alertMessage,
|
||||
andForceLocalization: forceLanguage)
|
||||
|
||||
return String(format: message, appName, currentAppStoreVersion)
|
||||
}
|
||||
|
||||
/// The localized string for the `UIAlertController`'s title field. .
|
||||
///
|
||||
/// - Returns: A localized string for the phrase "Update Available".
|
||||
public func alertTitle() -> String {
|
||||
return Bundle.localizedString(forKey: AlertConstants.alertTitle,
|
||||
andForceLocalization: forceLanguage)
|
||||
}
|
||||
|
||||
/// The localized string for the "Next time" `UIAlertAction`.
|
||||
///
|
||||
/// - Returns: A localized string for the phrase "Next time".
|
||||
public func nextTimeButtonTitle() -> String {
|
||||
return Bundle.localizedString(forKey: AlertConstants.nextTimeButtonTitle,
|
||||
andForceLocalization: forceLanguage)
|
||||
}
|
||||
|
||||
/// The localized string for the "Skip this version" `UIAlertAction`.
|
||||
///
|
||||
/// - Returns: A localized string for the phrase "Skip this version".
|
||||
public func skipButtonTitle() -> String {
|
||||
return Bundle.localizedString(forKey: AlertConstants.skipButtonTitle,
|
||||
andForceLocalization: forceLanguage)
|
||||
}
|
||||
|
||||
/// The localized string for the "Update" `UIAlertAction`.
|
||||
///
|
||||
/// - Returns: A localized string for the phrase "Update".
|
||||
public func updateButtonTitle() -> String {
|
||||
return Bundle.localizedString(forKey: AlertConstants.updateButtonTitle,
|
||||
andForceLocalization: forceLanguage)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// Model.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/27/19.
|
||||
// Copyright © 2019 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The validated and unwrapped `APIModel`.
|
||||
/// This model is presented to the end user in Siren's completion handler.
|
||||
public struct Model {
|
||||
|
||||
/// The app's App ID.
|
||||
public let appID: Int
|
||||
|
||||
/// The release date for the latest version of the app.
|
||||
public let currentVersionReleaseDate: String
|
||||
|
||||
/// The minimum version of iOS that the current version of the app requires.
|
||||
public let minimumOSVersion: String
|
||||
|
||||
/// The releases notes from the latest version of the app.
|
||||
public let releaseNotes: String?
|
||||
|
||||
/// The latest version of the app.
|
||||
public let version: String
|
||||
|
||||
/// The initializer for the `public` facing Model type.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - appID: The app's App ID.
|
||||
/// - currentVersionReleaseDate: The release date for the latest version of the app.
|
||||
/// - minimumOSVersion: The minimum version of iOS that the current version of the app requires.
|
||||
/// - releaseNotes: The releases notes from the latest version of the app.
|
||||
/// - version: The latest version of the app.
|
||||
init(appID: Int,
|
||||
currentVersionReleaseDate: String,
|
||||
minimumOSVersion: String,
|
||||
releaseNotes: String?,
|
||||
version: String) {
|
||||
self.appID = appID
|
||||
self.currentVersionReleaseDate = currentVersionReleaseDate
|
||||
self.minimumOSVersion = minimumOSVersion
|
||||
self.releaseNotes = releaseNotes
|
||||
self.version = version
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// PerformCheck.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 2/1/19.
|
||||
// Copyright © 2019 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The type of check to perform when Siren's `wail` method is performed.
|
||||
///
|
||||
/// - Note: Alert presentation will still respct the settings that are set
|
||||
/// for `UpdatePromptFrequency` and `showAlertAfterCurrentVersionHasBeenReleasedForDays`
|
||||
public enum PerformCheck {
|
||||
/// Performs a version check only when Siren's `wail` method is called,
|
||||
/// as the `UIApplication.didBecomeActiveNotification` is ignored.
|
||||
case onDemand
|
||||
|
||||
/// (DEFAULT) Perform a version check whenever the app enters the foreground.
|
||||
/// This value must be set when Siren's `wail` method is called to enable the
|
||||
/// `UIApplication.didBecomeActiveNotification` observer.
|
||||
case onForeground
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// Rules.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Sabintsev, Arthur on 11/18/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Alert Presentation Rules for Siren.
|
||||
public struct Rules {
|
||||
/// The type of alert that should be presented.
|
||||
let alertType: AlertType
|
||||
|
||||
/// The frequency in which a the user is prompted to update the app
|
||||
/// once a new version is available in the App Store and if they have not updated yet.
|
||||
let frequency: UpdatePromptFrequency
|
||||
|
||||
/// Initializes the alert presentation rules.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - frequency: How often a user should be prompted to update the app once a new version is available in the App Store.
|
||||
/// - alertType: The type of alert that should be presented.
|
||||
public init(promptFrequency frequency: UpdatePromptFrequency,
|
||||
forAlertType alertType: AlertType) {
|
||||
self.frequency = frequency
|
||||
self.alertType = alertType
|
||||
}
|
||||
|
||||
/// Performs a version check immediately, but allows the user to skip updating the app until the next time the app becomes active.
|
||||
public static var annoying: Rules {
|
||||
return Rules(promptFrequency: .immediately, forAlertType: .option)
|
||||
}
|
||||
|
||||
/// Performs a version check immediately and forces the user to update the app.
|
||||
public static var critical: Rules {
|
||||
return Rules(promptFrequency: .immediately, forAlertType: .force)
|
||||
}
|
||||
|
||||
/// Performs a version check once a day, but allows the user to skip updating the app until
|
||||
/// the next time the app becomes active or skipping the update all together until another version is released.
|
||||
///
|
||||
/// This is the default setting.
|
||||
public static var `default`: Rules {
|
||||
return Rules(promptFrequency: .daily, forAlertType: .skip)
|
||||
}
|
||||
|
||||
/// Performs a version check weekly, but allows the user to skip updating the app until the next time the app becomes active.
|
||||
public static var hinting: Rules {
|
||||
return Rules(promptFrequency: .weekly, forAlertType: .option)
|
||||
}
|
||||
|
||||
/// Performs a version check daily, but allows the user to skip updating the app until the next time the app becomes active.
|
||||
public static var persistent: Rules {
|
||||
return Rules(promptFrequency: .daily, forAlertType: .option)
|
||||
}
|
||||
|
||||
/// Performs a version check weekly, but allows the user to skip updating the app until
|
||||
/// the next time the app becomes active or skipping the update all together until another version is released.
|
||||
public static var relaxed: Rules {
|
||||
return Rules(promptFrequency: .weekly, forAlertType: .skip)
|
||||
}
|
||||
}
|
||||
|
||||
// Rules-related Constants
|
||||
public extension Rules {
|
||||
/// Determines the type of alert to present after a successful version check has been performed.
|
||||
enum AlertType {
|
||||
/// Forces the user to update your app (1 button alert).
|
||||
case force
|
||||
/// Presents the user with option to update app now or at next launch (2 button alert).
|
||||
case option
|
||||
/// Presents the user with option to update the app now, at next launch, or to skip this version all together (3 button alert).
|
||||
case skip
|
||||
/// Doesn't present the alert.
|
||||
/// Use this option if you would like to present a custom alert to the end-user.
|
||||
case none
|
||||
}
|
||||
|
||||
/// Determines the frequency in which the user is prompted to update the app
|
||||
/// once a new version is available in the App Store and if they have not updated yet.
|
||||
enum UpdatePromptFrequency: UInt {
|
||||
/// Version check performed every time the app is launched.
|
||||
case immediately = 0
|
||||
/// Version check performed once a day.
|
||||
case daily = 1
|
||||
/// Version check performed once a week.
|
||||
case weekly = 7
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// UpdateResults.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 12/1/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The relevant metadata returned from Siren upon completing a successful version check.
|
||||
public struct UpdateResults {
|
||||
/// The `UIAlertAction` the user chose upon being presented with the update alert.
|
||||
/// Defaults to `unknown` until an alert is actually presented.
|
||||
public var alertAction: AlertAction = .unknown
|
||||
|
||||
/// The Siren-supported locale that was used for the string in the update alert.
|
||||
public let localization: Localization
|
||||
|
||||
/// The Swift-mapped and unwrapped API model, if a successful version check was performed.
|
||||
public let model: Model
|
||||
|
||||
/// The type of update that was returned for the API.
|
||||
public var updateType: RulesManager.UpdateType = .unknown
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
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." = "Μια νέα έκδοση του %@ είναι διαθέσιμη. Παρακαλώ κάντε αναβάθμιση στο %@ τώρα.";
|
||||
|
||||
/* 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" = "Αναβάθμιση";
|
||||
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";
|
||||
@@ -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";
|
||||
+5
-5
@@ -1,14 +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 līdz %@ versijai.";
|
||||
"A new version of %@ is available. Please update to version %@ now." = "Versi baru %@ tersedia. Perbarui ke versi %@ sekarang.";
|
||||
|
||||
/* Update alert title */
|
||||
"Update Available" = "Atjaunojums";
|
||||
"Update Available" = "Pembaruan Tersedia";
|
||||
|
||||
/* Update alert dismiss button title */
|
||||
"Next time" = "Nākošreiz";
|
||||
"Next time" = "Lain kali";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Skip this version" = "Palaist garām šo versiju";
|
||||
"Skip this version" = "Lewati versi ini";
|
||||
|
||||
/* Update alert skip button title */
|
||||
"Update" = "Atjaunot";
|
||||
"Update" = "Perbarui";
|
||||
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." = "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." = "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";
|
||||
BIN
Binary file not shown.
+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 %@.";
|
||||
|
||||
/* 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";
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+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";
|
||||
@@ -0,0 +1,328 @@
|
||||
//
|
||||
// Siren.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 1/3/15.
|
||||
// Copyright (c) 2015 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
/// The Siren Class.
|
||||
public final class Siren: NSObject {
|
||||
/// Return results or errors obtained from performing a version check with Siren.
|
||||
public typealias ResultsHandler = (Result<UpdateResults, KnownError>) -> Void
|
||||
|
||||
/// The Siren singleton. The main point of entry to the Siren library.
|
||||
public static let shared = Siren()
|
||||
|
||||
/// The manager that controls the App Store API that is
|
||||
/// used to fetch the latest version of the app.
|
||||
///
|
||||
/// Defaults to the US App Store.
|
||||
public lazy var apiManager: APIManager = .default
|
||||
|
||||
/// The manager that controls the update alert's string localization and tint color.
|
||||
///
|
||||
/// Defaults the string's lange localization to the user's device localization.
|
||||
public lazy var presentationManager: PresentationManager = .default
|
||||
|
||||
/// The manager that controls the type of alert that should be displayed
|
||||
/// and how often an alert should be displayed dpeneding on the type
|
||||
/// of update that is available relative to the installed version of the app
|
||||
/// (e.g., different rules for major, minor, patch and revision updated can be used).
|
||||
///
|
||||
/// Defaults to performing a version check once a day with an alert that allows
|
||||
/// the user to skip updating the app until the next time the app becomes active or
|
||||
/// skipping the update all together until another version is released.
|
||||
public lazy var rulesManager: RulesManager = .default
|
||||
|
||||
/// The current installed version of your app.
|
||||
lazy var currentInstalledVersion: String? = Bundle.version()
|
||||
|
||||
/// The retained `NotificationCenter` observer that listens for `UIApplication.didBecomeActiveNotification` notifications.
|
||||
var applicationDidBecomeActiveObserver: NSObjectProtocol?
|
||||
|
||||
/// The retained `NotificationCenter` observer that listens for `UIApplication.willResignActiveNotification` notifications.
|
||||
var applicationWillResignActiveObserver: NSObjectProtocol?
|
||||
|
||||
/// The retained `NotificationCenter` observer that listens for `UIApplication.didEnterBackgroundNotification` notifications.
|
||||
var applicationDidEnterBackgroundObserver: NSObjectProtocol?
|
||||
|
||||
/// The last date that an alert was presented to the user.
|
||||
private var alertPresentationDate: Date? = UserDefaults.alertPresentationDate
|
||||
|
||||
/// The App Store's unique identifier for an app.
|
||||
private var appID: Int?
|
||||
|
||||
/// The completion handler used to return the results or errors returned by Siren.
|
||||
private var resultsHandler: ResultsHandler?
|
||||
|
||||
/// The deinitialization method that clears out all observers,
|
||||
deinit {
|
||||
presentationManager.cleanUp()
|
||||
removeForegroundObservers()
|
||||
removeBackgroundObservers()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Public API Interface
|
||||
|
||||
public extension Siren {
|
||||
/// This method executes the Siren version checking and alert presentation flow.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - performCheck: Defines how the version check flow is entered. Defaults to `.onForeground`.
|
||||
/// - handler: Returns the metadata around a successful version check and interaction with the update modal or it returns nil.
|
||||
func wail(performCheck: PerformCheck = .onForeground,
|
||||
completion handler: ResultsHandler? = nil) {
|
||||
resultsHandler = handler
|
||||
|
||||
switch performCheck {
|
||||
case .onDemand:
|
||||
removeForegroundObservers()
|
||||
performVersionCheck()
|
||||
case .onForeground:
|
||||
addForegroundObservers()
|
||||
}
|
||||
|
||||
// Add background app state change observers.
|
||||
addBackgroundObservers()
|
||||
}
|
||||
|
||||
/// Launches the AppStore in two situations when the user clicked the `Update` button in the UIAlertController modal.
|
||||
///
|
||||
/// This function is marked `public` as a convenience for those developers who decide to build a custom alert modal
|
||||
/// instead of using Siren's prebuilt update alert.
|
||||
func launchAppStore() {
|
||||
guard let appID = appID,
|
||||
let url = URL(string: "https://itunes.apple.com/app/id\(appID)") else {
|
||||
resultsHandler?(.failure(.malformedURL))
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
if #available(iOS 10.0, *) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
} else {
|
||||
UIApplication.shared.openURL(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Version Check and Alert Presentation Flow
|
||||
|
||||
private extension Siren {
|
||||
/// Initiates the unidirectional version checking flow.
|
||||
func performVersionCheck() {
|
||||
alertPresentationDate = UserDefaults.alertPresentationDate
|
||||
apiManager.performVersionCheckRequest { result in
|
||||
switch result {
|
||||
case .success(let apiModel):
|
||||
self.validate(apiModel: apiModel)
|
||||
case .failure(let error):
|
||||
self.resultsHandler?(.failure(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Validates the parsed and mapped iTunes Lookup Model
|
||||
/// to guarantee all the relevant data was returned before
|
||||
/// attempting to present an alert.
|
||||
///
|
||||
/// - Parameter apiModel: The iTunes Lookup Model.
|
||||
func validate(apiModel: APIModel) {
|
||||
// Check if the latest version is compatible with current device's version of iOS.
|
||||
guard DataParser.isUpdateCompatibleWithDeviceOS(for: apiModel) else {
|
||||
resultsHandler?(.failure(.appStoreOSVersionUnsupported))
|
||||
return
|
||||
}
|
||||
|
||||
// Check and store the App ID .
|
||||
guard let results = apiModel.results.first,
|
||||
let appID = apiModel.results.first?.appID else {
|
||||
resultsHandler?(.failure(.appStoreAppIDFailure))
|
||||
return
|
||||
}
|
||||
self.appID = appID
|
||||
|
||||
// Check and store the current App Store version.
|
||||
guard let currentAppStoreVersion = apiModel.results.first?.version else {
|
||||
resultsHandler?(.failure(.appStoreVersionArrayFailure))
|
||||
return
|
||||
}
|
||||
|
||||
// Check if the App Store version is newer than the currently installed version.
|
||||
guard DataParser.isAppStoreVersionNewer(installedVersion: currentInstalledVersion,
|
||||
appStoreVersion: currentAppStoreVersion) else {
|
||||
resultsHandler?(.failure(.noUpdateAvailable))
|
||||
return
|
||||
}
|
||||
|
||||
// Check the release date of the current version.
|
||||
guard let currentVersionReleaseDate = apiModel.results.first?.currentVersionReleaseDate,
|
||||
let daysSinceRelease = Date.days(since: currentVersionReleaseDate) else {
|
||||
resultsHandler?(.failure(.currentVersionReleaseDate))
|
||||
return
|
||||
}
|
||||
|
||||
// Check if applicaiton has been released for the amount of days defined by the app consuming Siren.
|
||||
guard daysSinceRelease >= rulesManager.releasedForDays else {
|
||||
resultsHandler?(.failure(.releasedTooSoon(daysSinceRelease: daysSinceRelease,
|
||||
releasedForDays: rulesManager.releasedForDays)))
|
||||
return
|
||||
}
|
||||
|
||||
let model = Model(appID: appID,
|
||||
currentVersionReleaseDate: currentVersionReleaseDate,
|
||||
minimumOSVersion: results.minimumOSVersion,
|
||||
releaseNotes: results.releaseNotes,
|
||||
version: results.version)
|
||||
|
||||
determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion: currentAppStoreVersion, andModel: model)
|
||||
}
|
||||
|
||||
/// Determines if the update alert can be presented based on the
|
||||
/// rules set in the `RulesManager` and the the skip version settings.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - currentAppStoreVersion: The curren version of the app in the App Store.
|
||||
/// - model: The iTunes Lookup Model.
|
||||
func determineIfAlertPresentationRulesAreSatisfied(forCurrentAppStoreVersion currentAppStoreVersion: String, andModel model: Model) {
|
||||
// Did the user:
|
||||
// - request to skip being prompted with version update alerts for a specific version
|
||||
// - and is the latest App Store update the same version that was requested?
|
||||
if let previouslySkippedVersion = UserDefaults.storedSkippedVersion,
|
||||
let currentInstalledVersion = currentInstalledVersion,
|
||||
!currentAppStoreVersion.isEmpty,
|
||||
currentAppStoreVersion == previouslySkippedVersion {
|
||||
resultsHandler?(.failure(.skipVersionUpdate(installedVersion: currentInstalledVersion,
|
||||
appStoreVersion: currentAppStoreVersion)))
|
||||
return
|
||||
}
|
||||
|
||||
let updateType = DataParser.parseForUpdate(forInstalledVersion: currentInstalledVersion,
|
||||
andAppStoreVersion: currentAppStoreVersion)
|
||||
do {
|
||||
let rules = try rulesManager.loadRulesForUpdateType(updateType)
|
||||
|
||||
if rules.frequency == .immediately {
|
||||
presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType)
|
||||
} else {
|
||||
guard let alertPresentationDate = alertPresentationDate else {
|
||||
presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType)
|
||||
return
|
||||
}
|
||||
if Date.days(since: alertPresentationDate) >= rules.frequency.rawValue {
|
||||
presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion, model: model, andUpdateType: updateType)
|
||||
} else {
|
||||
resultsHandler?(.failure(.recentlyPrompted))
|
||||
}
|
||||
}
|
||||
} catch let error as KnownError {
|
||||
resultsHandler?(.failure(error))
|
||||
} catch { // This path should never be entered, but this silences an error.
|
||||
resultsHandler?(.failure(.noUpdateAvailable))
|
||||
}
|
||||
}
|
||||
|
||||
/// Presents the update alert to the end user.
|
||||
/// Upon tapping a value on the alert view, a completion handler will return all relevant metadata to the app.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - rules: The rules for how to present the alert.
|
||||
/// - currentAppStoreVersion: The current version of the app in the App Store.
|
||||
/// - model: The iTunes Lookup Model.
|
||||
/// - updateType: The type of update that is available based on the version found in the App Store.
|
||||
func presentAlert(withRules rules: Rules,
|
||||
forCurrentAppStoreVersion currentAppStoreVersion: String,
|
||||
model: Model,
|
||||
andUpdateType updateType: RulesManager.UpdateType) {
|
||||
presentationManager.presentAlert(withRules: rules, forCurrentAppStoreVersion: currentAppStoreVersion) { [weak self] alertAction, currentAppStoreVersion in
|
||||
guard let self = self else { return }
|
||||
self.processAlertAction(alertAction: alertAction, currentAppStoreVersion: currentAppStoreVersion)
|
||||
|
||||
let results = UpdateResults(alertAction: alertAction,
|
||||
localization: self.presentationManager.localization,
|
||||
model: model,
|
||||
updateType: updateType)
|
||||
self.resultsHandler?(.success(results))
|
||||
}
|
||||
}
|
||||
|
||||
func processAlertAction(alertAction: AlertAction, currentAppStoreVersion: String?) {
|
||||
switch alertAction {
|
||||
case .appStore:
|
||||
launchAppStore()
|
||||
case .skip:
|
||||
guard let currentAppStoreVersion = currentAppStoreVersion else { return }
|
||||
UserDefaults.storedSkippedVersion = currentAppStoreVersion
|
||||
UserDefaults.standard.synchronize()
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Add Observers
|
||||
|
||||
private extension Siren {
|
||||
/// Adds an observer that listens for app launching/relaunching.
|
||||
func addForegroundObservers() {
|
||||
guard applicationDidBecomeActiveObserver == nil else { return }
|
||||
applicationDidBecomeActiveObserver = NotificationCenter
|
||||
.default
|
||||
.addObserver(forName: UIApplication.didBecomeActiveNotification,
|
||||
object: nil,
|
||||
queue: nil) { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.performVersionCheck()
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds an observer that listens for when the user enters the app switcher
|
||||
/// and when the app is sent to the background.
|
||||
func addBackgroundObservers() {
|
||||
if applicationWillResignActiveObserver == nil {
|
||||
applicationWillResignActiveObserver = NotificationCenter
|
||||
.default
|
||||
.addObserver(forName: UIApplication.willResignActiveNotification,
|
||||
object: nil,
|
||||
queue: nil) { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.presentationManager.cleanUp()
|
||||
}
|
||||
}
|
||||
|
||||
if applicationDidEnterBackgroundObserver == nil {
|
||||
applicationDidEnterBackgroundObserver = NotificationCenter
|
||||
.default
|
||||
.addObserver(forName: UIApplication.didEnterBackgroundNotification,
|
||||
object: nil,
|
||||
queue: nil) { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.presentationManager.cleanUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Remove Observers
|
||||
|
||||
private extension Siren {
|
||||
/// Removes the observer that listens for app launching/relaunching.
|
||||
func removeForegroundObservers() {
|
||||
NotificationCenter.default.removeObserver(applicationDidBecomeActiveObserver as Any)
|
||||
applicationDidBecomeActiveObserver = nil
|
||||
}
|
||||
|
||||
/// Remove the observers that list to app resignation and app backgrounding.
|
||||
func removeBackgroundObservers() {
|
||||
NotificationCenter.default.removeObserver(applicationWillResignActiveObserver as Any)
|
||||
applicationWillResignActiveObserver = nil
|
||||
|
||||
NotificationCenter.default.removeObserver(applicationDidEnterBackgroundObserver as Any)
|
||||
applicationDidEnterBackgroundObserver = nil
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// DataParser.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 11/25/18.
|
||||
// Copyright © 2018 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
/// Version parsing functions for Siren.
|
||||
struct DataParser {
|
||||
/// Checks to see if the App Store version of the app is newer than the installed version.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - installedVersion: The installed version of the app.
|
||||
/// - appStoreVersion: The App Store version of the app.
|
||||
/// - Returns: `true` if the App Store version is newer. Otherwise, `false`.
|
||||
static func isAppStoreVersionNewer(installedVersion: String?, appStoreVersion: String?) -> Bool {
|
||||
guard let installedVersion = installedVersion,
|
||||
let appStoreVersion = appStoreVersion,
|
||||
(installedVersion.compare(appStoreVersion, options: .numeric) == .orderedAscending) else {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/// Validates that the latest version in the App Store is compatible with the device's current version of iOS.
|
||||
///
|
||||
/// - Parameter model: The iTunes Lookup Model.
|
||||
/// - Returns: `true` if the latest version is compatible with the device's current version of iOS. Otherwise, `false`.
|
||||
static func isUpdateCompatibleWithDeviceOS(for model: APIModel) -> Bool {
|
||||
guard let requiredOSVersion = model.results.first?.minimumOSVersion else {
|
||||
return false
|
||||
}
|
||||
|
||||
let systemVersion = UIDevice.current.systemVersion
|
||||
|
||||
guard systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedDescending ||
|
||||
systemVersion.compare(requiredOSVersion, options: .numeric) == .orderedSame else {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/// The type of update that is returned from the API in relation to the version of the app that is installed.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - installedVersion: The installed version of the app.
|
||||
/// - appStoreVersion: The App Store version of the app.
|
||||
/// - Returns: The type of update in relation to the version of the app that is installed.
|
||||
static func parseForUpdate(forInstalledVersion installedVersion: String?,
|
||||
andAppStoreVersion appStoreVersion: String?) -> RulesManager.UpdateType {
|
||||
guard let installedVersion = installedVersion,
|
||||
let appStoreVersion = appStoreVersion else {
|
||||
return .unknown
|
||||
}
|
||||
|
||||
let oldVersion = split(version: installedVersion)
|
||||
let newVersion = split(version: appStoreVersion)
|
||||
|
||||
guard let newVersionFirst = newVersion.first,
|
||||
let oldVersionFirst = oldVersion.first else {
|
||||
return .unknown
|
||||
}
|
||||
|
||||
if newVersionFirst > oldVersionFirst { // A.b.c.d
|
||||
return .major
|
||||
} else if newVersion.count > 1 && (oldVersion.count <= 1 || newVersion[1] > oldVersion[1]) { // a.B.c.d
|
||||
return .minor
|
||||
} else if newVersion.count > 2 && (oldVersion.count <= 2 || newVersion[2] > oldVersion[2]) { // a.b.C.d
|
||||
return .patch
|
||||
} else if newVersion.count > 3 && (oldVersion.count <= 3 || newVersion[3] > oldVersion[3]) { // a.b.c.D
|
||||
return .revision
|
||||
} else {
|
||||
return .unknown
|
||||
}
|
||||
}
|
||||
|
||||
/// Splits a version-formatted `String into an `[Int]`.
|
||||
///
|
||||
/// Converts `"a.b.c.d"` into `[a, b, c, d]`.
|
||||
///
|
||||
/// - Parameter version: The version formatted `String`.
|
||||
///
|
||||
/// - Returns: An array of integers representing a version of the app.
|
||||
private static func split(version: String) -> [Int] {
|
||||
return version.lazy.split {$0 == "."}.map { String($0) }.map {Int($0) ?? 0}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// KnownError.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 8/6/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Enumerates all potentials errors that Siren can handle.
|
||||
public enum KnownError: LocalizedError {
|
||||
/// Error retrieving trackId as the JSON does not contain a 'trackId' key.
|
||||
case appStoreAppIDFailure
|
||||
/// Error retrieving App Store data as JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error.
|
||||
case appStoreDataRetrievalEmptyResults
|
||||
/// Error retrieving App Store data as an error was returned.
|
||||
case appStoreDataRetrievalFailure(underlyingError: Error?)
|
||||
/// Error parsing App Store JSON data.
|
||||
case appStoreJSONParsingFailure(underlyingError: Error)
|
||||
/// The version of iOS on the device is lower than that of the one required by the app version update.
|
||||
case appStoreOSVersionUnsupported
|
||||
/// Error retrieving App Store verson number as the JSON does not contain a `version` key.
|
||||
case appStoreVersionArrayFailure
|
||||
/// The `currentVersionReleaseDate` key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
|
||||
case currentVersionReleaseDate
|
||||
/// One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible.
|
||||
case malformedURL
|
||||
/// Please make sure that you have set a `Bundle Identifier` in your project.
|
||||
case missingBundleID
|
||||
/// No new update available.
|
||||
case noUpdateAvailable
|
||||
/// Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the `UpdatePromptFrequency.immediately` rule in `RulesManager`
|
||||
case recentlyPrompted
|
||||
/// The app has been released for X days, but Siren cannot prompt the user until Y (where Y > X) days have passed.
|
||||
case releasedTooSoon(daysSinceRelease: Int, releasedForDays: Int)
|
||||
/// The user has opted to skip updating their current version of the app to the current App Store version.
|
||||
case skipVersionUpdate(installedVersion: String, appStoreVersion: String)
|
||||
|
||||
/// The localized description for each error handled by Siren.
|
||||
public var localizedDescription: String {
|
||||
switch self {
|
||||
case .appStoreAppIDFailure:
|
||||
return "\(KnownError.sirenError) Error retrieving trackId as the JSON does not contain a `trackId` key."
|
||||
case .appStoreDataRetrievalFailure(let error?):
|
||||
return "\(KnownError.sirenError) Error retrieving App Store data as an error was returned\nAlso, the following system level error was returned: \(error)"
|
||||
case .appStoreDataRetrievalEmptyResults:
|
||||
return "\(KnownError.sirenError) Error retrieving App Store data as the JSON results were empty. Is your app available in the US? If not, change the `countryCode` variable to fix this error."
|
||||
case .appStoreDataRetrievalFailure(.none):
|
||||
return "\(KnownError.sirenError) Error retrieving App Store data as an error was returned."
|
||||
case .appStoreJSONParsingFailure(let error):
|
||||
return "\(KnownError.sirenError) Error parsing App Store JSON data.\nAlso, the following system level error was returned: \(error)"
|
||||
case .appStoreOSVersionUnsupported:
|
||||
return "\(KnownError.sirenError) The version of iOS on the device is lower than that of the one required by the app version update."
|
||||
case .appStoreVersionArrayFailure:
|
||||
return "\(KnownError.sirenError) Error retrieving App Store verson number as the JSON does not contain a `version` key."
|
||||
case .currentVersionReleaseDate:
|
||||
return "\(KnownError.sirenError) The `currentVersionReleaseDate` key is missing in the JSON payload. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible."
|
||||
case .malformedURL:
|
||||
return "\(KnownError.sirenError) One of the iTunes URLs used in Siren is malformed. Please leave an issue on https://github.com/ArtSabintsev/Siren with as many details as possible."
|
||||
case .missingBundleID:
|
||||
return "\(KnownError.sirenError) Please make sure that you have set a `Bundle Identifier` in your project."
|
||||
case .noUpdateAvailable:
|
||||
return "\(KnownError.sirenError) No new update available."
|
||||
case .recentlyPrompted:
|
||||
return "\(KnownError.sirenError) Siren will not present an update alert if it performed one too recently. If you would like to present an alert every time Siren is called, please consider setting the `\(Rules.UpdatePromptFrequency.self).immediately` rule in `\(RulesManager.self)`"
|
||||
case .releasedTooSoon(let daysSinceRelease, let releasedForDays):
|
||||
return "\(KnownError.sirenError) The app has been released for \(daysSinceRelease) days, but Siren cannot prompt the user until \(releasedForDays) days have passed."
|
||||
case .skipVersionUpdate(let installedVersion, let appStoreVersion):
|
||||
return "\(KnownError.sirenError) The user has opted to skip updating their current version of the app (\(installedVersion)) to the current App Store version (\(appStoreVersion))."
|
||||
}
|
||||
}
|
||||
|
||||
/// An easily identifiable prefix for all errors thrown by Siren.
|
||||
private static var sirenError: String {
|
||||
return "[Siren Error]"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// SirenViewController.swift
|
||||
// Siren
|
||||
//
|
||||
// Created by Arthur Sabintsev on 3/17/17.
|
||||
// Copyright © 2017 Sabintsev iOS Projects. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
/// `UIViewController` Extension for Siren
|
||||
final class SirenViewController: UIViewController {
|
||||
|
||||
/// This creates a retain cycle.
|
||||
/// This is needed to retain the UIAlertController in iOS 13.0+
|
||||
var retainedWindow: UIWindow?
|
||||
|
||||
/// `UIStatusBarStyle` override.
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle {
|
||||
if #available(iOS 13.0, *) {
|
||||
return retainedWindow?.windowScene?.statusBarManager?.statusBarStyle ?? .default
|
||||
} else {
|
||||
return UIApplication.shared.statusBarStyle
|
||||
}
|
||||
}
|
||||
|
||||
deinit {
|
||||
retainedWindow = nil
|
||||
}
|
||||
}
|
||||
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
<!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 name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">Siren Docs</a> (100% documented)</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>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/AlertAction.html">AlertAction</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/KnownError.html">KnownError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/PerformCheck.html">PerformCheck</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Structs.html">Structures</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/APIManager.html">APIManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/AlertConstants.html">AlertConstants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Localization.html">Localization</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Localization/Language.html">– Language</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Model.html">Model</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/PresentationManager.html">PresentationManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Rules.html">Rules</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Rules/AlertType.html">– AlertType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/Rules/UpdatePromptFrequency.html">– UpdatePromptFrequency</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/RulesManager.html">RulesManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/RulesManager/UpdateType.html">– UpdateType</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Structs/UpdateResults.html">UpdateResults</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">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@M@Siren@objc(cs)Siren"></a>
|
||||
<a name="//apple_ref/swift/Class/Siren" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@Siren@objc(cs)Siren">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.</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 swift"><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>© 2019 <a class="link" href="https://github.com/ArtSabintsev/Siren" target="_blank" rel="external">Arthur Ariel Sabintsev</a>. All rights reserved. (Last updated: 2019-09-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user