";
844 | };
845 | /* End PBXVariantGroup section */
846 |
847 | /* Begin XCBuildConfiguration section */
848 | 3D9C429622745894000A6585 /* Debug */ = {
849 | isa = XCBuildConfiguration;
850 | buildSettings = {
851 | ALWAYS_SEARCH_USER_PATHS = NO;
852 | CLANG_ANALYZER_NONNULL = YES;
853 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
854 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
855 | CLANG_CXX_LIBRARY = "libc++";
856 | CLANG_ENABLE_MODULES = YES;
857 | CLANG_ENABLE_OBJC_ARC = YES;
858 | CLANG_ENABLE_OBJC_WEAK = YES;
859 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
860 | CLANG_WARN_BOOL_CONVERSION = YES;
861 | CLANG_WARN_COMMA = YES;
862 | CLANG_WARN_CONSTANT_CONVERSION = YES;
863 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
864 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
865 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
866 | CLANG_WARN_EMPTY_BODY = YES;
867 | CLANG_WARN_ENUM_CONVERSION = YES;
868 | CLANG_WARN_INFINITE_RECURSION = YES;
869 | CLANG_WARN_INT_CONVERSION = YES;
870 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
871 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
872 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
873 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
874 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
875 | CLANG_WARN_STRICT_PROTOTYPES = YES;
876 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
877 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
878 | CLANG_WARN_UNREACHABLE_CODE = YES;
879 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
880 | CODE_SIGN_IDENTITY = "iPhone Developer";
881 | COPY_PHASE_STRIP = NO;
882 | CURRENT_PROJECT_VERSION = 1;
883 | DEBUG_INFORMATION_FORMAT = dwarf;
884 | ENABLE_STRICT_OBJC_MSGSEND = YES;
885 | ENABLE_TESTABILITY = YES;
886 | GCC_C_LANGUAGE_STANDARD = gnu11;
887 | GCC_DYNAMIC_NO_PIC = NO;
888 | GCC_NO_COMMON_BLOCKS = YES;
889 | GCC_OPTIMIZATION_LEVEL = 0;
890 | GCC_PREPROCESSOR_DEFINITIONS = (
891 | "DEBUG=1",
892 | "$(inherited)",
893 | );
894 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
895 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
896 | GCC_WARN_UNDECLARED_SELECTOR = YES;
897 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
898 | GCC_WARN_UNUSED_FUNCTION = YES;
899 | GCC_WARN_UNUSED_VARIABLE = YES;
900 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
901 | MACOSX_DEPLOYMENT_TARGET = 10.10;
902 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
903 | MTL_FAST_MATH = YES;
904 | ONLY_ACTIVE_ARCH = YES;
905 | SDKROOT = iphoneos;
906 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
907 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
908 | SWIFT_VERSION = 5.0;
909 | VERSIONING_SYSTEM = "apple-generic";
910 | VERSION_INFO_PREFIX = "";
911 | };
912 | name = Debug;
913 | };
914 | 3D9C429722745894000A6585 /* Release */ = {
915 | isa = XCBuildConfiguration;
916 | buildSettings = {
917 | ALWAYS_SEARCH_USER_PATHS = NO;
918 | CLANG_ANALYZER_NONNULL = YES;
919 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
920 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
921 | CLANG_CXX_LIBRARY = "libc++";
922 | CLANG_ENABLE_MODULES = YES;
923 | CLANG_ENABLE_OBJC_ARC = YES;
924 | CLANG_ENABLE_OBJC_WEAK = YES;
925 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
926 | CLANG_WARN_BOOL_CONVERSION = YES;
927 | CLANG_WARN_COMMA = YES;
928 | CLANG_WARN_CONSTANT_CONVERSION = YES;
929 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
930 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
931 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
932 | CLANG_WARN_EMPTY_BODY = YES;
933 | CLANG_WARN_ENUM_CONVERSION = YES;
934 | CLANG_WARN_INFINITE_RECURSION = YES;
935 | CLANG_WARN_INT_CONVERSION = YES;
936 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
937 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
938 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
939 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
940 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
941 | CLANG_WARN_STRICT_PROTOTYPES = YES;
942 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
943 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
944 | CLANG_WARN_UNREACHABLE_CODE = YES;
945 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
946 | CODE_SIGN_IDENTITY = "iPhone Developer";
947 | COPY_PHASE_STRIP = NO;
948 | CURRENT_PROJECT_VERSION = 1;
949 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
950 | ENABLE_NS_ASSERTIONS = NO;
951 | ENABLE_STRICT_OBJC_MSGSEND = YES;
952 | GCC_C_LANGUAGE_STANDARD = gnu11;
953 | GCC_NO_COMMON_BLOCKS = YES;
954 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
955 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
956 | GCC_WARN_UNDECLARED_SELECTOR = YES;
957 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
958 | GCC_WARN_UNUSED_FUNCTION = YES;
959 | GCC_WARN_UNUSED_VARIABLE = YES;
960 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
961 | MACOSX_DEPLOYMENT_TARGET = 10.10;
962 | MTL_ENABLE_DEBUG_INFO = NO;
963 | MTL_FAST_MATH = YES;
964 | SDKROOT = iphoneos;
965 | SWIFT_COMPILATION_MODE = wholemodule;
966 | SWIFT_OPTIMIZATION_LEVEL = "-O";
967 | SWIFT_VERSION = 5.0;
968 | VALIDATE_PRODUCT = YES;
969 | VERSIONING_SYSTEM = "apple-generic";
970 | VERSION_INFO_PREFIX = "";
971 | };
972 | name = Release;
973 | };
974 | 3D9C429922745894000A6585 /* Debug */ = {
975 | isa = XCBuildConfiguration;
976 | buildSettings = {
977 | APPLICATION_EXTENSION_API_ONLY = YES;
978 | CLANG_ENABLE_MODULES = YES;
979 | CODE_SIGN_IDENTITY = "";
980 | CODE_SIGN_STYLE = Manual;
981 | DEFINES_MODULE = YES;
982 | DEVELOPMENT_TEAM = "";
983 | DYLIB_COMPATIBILITY_VERSION = 1;
984 | DYLIB_CURRENT_VERSION = 1;
985 | DYLIB_INSTALL_NAME_BASE = "@rpath";
986 | INFOPLIST_FILE = Configs/AGString.plist;
987 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
988 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
989 | LD_RUNPATH_SEARCH_PATHS = (
990 | "$(inherited)",
991 | "@executable_path/Frameworks",
992 | "@loader_path/Frameworks",
993 | );
994 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-iOS";
995 | PRODUCT_NAME = AGString;
996 | PROVISIONING_PROFILE_SPECIFIER = "";
997 | SKIP_INSTALL = YES;
998 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
999 | SWIFT_VERSION = 5.0;
1000 | TARGETED_DEVICE_FAMILY = "1,2";
1001 | };
1002 | name = Debug;
1003 | };
1004 | 3D9C429A22745894000A6585 /* Release */ = {
1005 | isa = XCBuildConfiguration;
1006 | buildSettings = {
1007 | APPLICATION_EXTENSION_API_ONLY = YES;
1008 | CLANG_ENABLE_MODULES = YES;
1009 | CODE_SIGN_IDENTITY = "";
1010 | CODE_SIGN_STYLE = Manual;
1011 | DEFINES_MODULE = YES;
1012 | DEVELOPMENT_TEAM = "";
1013 | DYLIB_COMPATIBILITY_VERSION = 1;
1014 | DYLIB_CURRENT_VERSION = 1;
1015 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1016 | INFOPLIST_FILE = Configs/AGString.plist;
1017 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1018 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1019 | LD_RUNPATH_SEARCH_PATHS = (
1020 | "$(inherited)",
1021 | "@executable_path/Frameworks",
1022 | "@loader_path/Frameworks",
1023 | );
1024 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-iOS";
1025 | PRODUCT_NAME = AGString;
1026 | PROVISIONING_PROFILE_SPECIFIER = "";
1027 | SKIP_INSTALL = YES;
1028 | SWIFT_VERSION = 5.0;
1029 | TARGETED_DEVICE_FAMILY = "1,2";
1030 | };
1031 | name = Release;
1032 | };
1033 | 3D9C42AF2274599D000A6585 /* Debug */ = {
1034 | isa = XCBuildConfiguration;
1035 | buildSettings = {
1036 | APPLICATION_EXTENSION_API_ONLY = YES;
1037 | CODE_SIGN_IDENTITY = "";
1038 | CODE_SIGN_STYLE = Manual;
1039 | DEFINES_MODULE = YES;
1040 | DEVELOPMENT_TEAM = "";
1041 | DYLIB_COMPATIBILITY_VERSION = 1;
1042 | DYLIB_CURRENT_VERSION = 1;
1043 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1044 | INFOPLIST_FILE = Configs/AGString.plist;
1045 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1046 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1047 | LD_RUNPATH_SEARCH_PATHS = (
1048 | "$(inherited)",
1049 | "@executable_path/Frameworks",
1050 | "@loader_path/Frameworks",
1051 | );
1052 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-tvOS";
1053 | PRODUCT_NAME = AGString;
1054 | PROVISIONING_PROFILE_SPECIFIER = "";
1055 | SDKROOT = appletvos;
1056 | SKIP_INSTALL = YES;
1057 | SWIFT_VERSION = 5.0;
1058 | TARGETED_DEVICE_FAMILY = 3;
1059 | TVOS_DEPLOYMENT_TARGET = 9.0;
1060 | };
1061 | name = Debug;
1062 | };
1063 | 3D9C42B02274599D000A6585 /* Release */ = {
1064 | isa = XCBuildConfiguration;
1065 | buildSettings = {
1066 | APPLICATION_EXTENSION_API_ONLY = YES;
1067 | CODE_SIGN_IDENTITY = "";
1068 | CODE_SIGN_STYLE = Manual;
1069 | DEFINES_MODULE = YES;
1070 | DEVELOPMENT_TEAM = "";
1071 | DYLIB_COMPATIBILITY_VERSION = 1;
1072 | DYLIB_CURRENT_VERSION = 1;
1073 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1074 | INFOPLIST_FILE = Configs/AGString.plist;
1075 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1076 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1077 | LD_RUNPATH_SEARCH_PATHS = (
1078 | "$(inherited)",
1079 | "@executable_path/Frameworks",
1080 | "@loader_path/Frameworks",
1081 | );
1082 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-tvOS";
1083 | PRODUCT_NAME = AGString;
1084 | PROVISIONING_PROFILE_SPECIFIER = "";
1085 | SDKROOT = appletvos;
1086 | SKIP_INSTALL = YES;
1087 | SWIFT_VERSION = 5.0;
1088 | TARGETED_DEVICE_FAMILY = 3;
1089 | TVOS_DEPLOYMENT_TARGET = 9.0;
1090 | };
1091 | name = Release;
1092 | };
1093 | 3D9C42BD227459D6000A6585 /* Debug */ = {
1094 | isa = XCBuildConfiguration;
1095 | buildSettings = {
1096 | APPLICATION_EXTENSION_API_ONLY = YES;
1097 | CODE_SIGN_IDENTITY = "";
1098 | CODE_SIGN_STYLE = Manual;
1099 | DEFINES_MODULE = YES;
1100 | DEVELOPMENT_TEAM = "";
1101 | DYLIB_COMPATIBILITY_VERSION = 1;
1102 | DYLIB_CURRENT_VERSION = 1;
1103 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1104 | INFOPLIST_FILE = Configs/AGString.plist;
1105 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1106 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1107 | LD_RUNPATH_SEARCH_PATHS = (
1108 | "$(inherited)",
1109 | "@executable_path/Frameworks",
1110 | "@loader_path/Frameworks",
1111 | );
1112 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-watchOS";
1113 | PRODUCT_NAME = AGString;
1114 | PROVISIONING_PROFILE_SPECIFIER = "";
1115 | SDKROOT = watchos;
1116 | SKIP_INSTALL = YES;
1117 | SWIFT_VERSION = 5.0;
1118 | TARGETED_DEVICE_FAMILY = 4;
1119 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
1120 | };
1121 | name = Debug;
1122 | };
1123 | 3D9C42BE227459D6000A6585 /* Release */ = {
1124 | isa = XCBuildConfiguration;
1125 | buildSettings = {
1126 | APPLICATION_EXTENSION_API_ONLY = YES;
1127 | CODE_SIGN_IDENTITY = "";
1128 | CODE_SIGN_STYLE = Manual;
1129 | DEFINES_MODULE = YES;
1130 | DEVELOPMENT_TEAM = "";
1131 | DYLIB_COMPATIBILITY_VERSION = 1;
1132 | DYLIB_CURRENT_VERSION = 1;
1133 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1134 | INFOPLIST_FILE = Configs/AGString.plist;
1135 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1136 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1137 | LD_RUNPATH_SEARCH_PATHS = (
1138 | "$(inherited)",
1139 | "@executable_path/Frameworks",
1140 | "@loader_path/Frameworks",
1141 | );
1142 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-watchOS";
1143 | PRODUCT_NAME = AGString;
1144 | PROVISIONING_PROFILE_SPECIFIER = "";
1145 | SDKROOT = watchos;
1146 | SKIP_INSTALL = YES;
1147 | SWIFT_VERSION = 5.0;
1148 | TARGETED_DEVICE_FAMILY = 4;
1149 | WATCHOS_DEPLOYMENT_TARGET = 2.0;
1150 | };
1151 | name = Release;
1152 | };
1153 | 3D9C42CB22745A07000A6585 /* Debug */ = {
1154 | isa = XCBuildConfiguration;
1155 | buildSettings = {
1156 | APPLICATION_EXTENSION_API_ONLY = YES;
1157 | CODE_SIGN_IDENTITY = "-";
1158 | CODE_SIGN_STYLE = Manual;
1159 | COMBINE_HIDPI_IMAGES = YES;
1160 | DEFINES_MODULE = YES;
1161 | DEVELOPMENT_TEAM = "";
1162 | DYLIB_COMPATIBILITY_VERSION = 1;
1163 | DYLIB_CURRENT_VERSION = 1;
1164 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1165 | FRAMEWORK_VERSION = A;
1166 | INFOPLIST_FILE = Configs/AGString.plist;
1167 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1168 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1169 | LD_RUNPATH_SEARCH_PATHS = (
1170 | "$(inherited)",
1171 | "@executable_path/../Frameworks",
1172 | "@loader_path/Frameworks",
1173 | );
1174 | MACOSX_DEPLOYMENT_TARGET = 10.10;
1175 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-macOS";
1176 | PRODUCT_NAME = AGString;
1177 | PROVISIONING_PROFILE_SPECIFIER = "";
1178 | SDKROOT = macosx;
1179 | SKIP_INSTALL = YES;
1180 | SWIFT_VERSION = 5.0;
1181 | };
1182 | name = Debug;
1183 | };
1184 | 3D9C42CC22745A07000A6585 /* Release */ = {
1185 | isa = XCBuildConfiguration;
1186 | buildSettings = {
1187 | APPLICATION_EXTENSION_API_ONLY = YES;
1188 | CODE_SIGN_IDENTITY = "-";
1189 | CODE_SIGN_STYLE = Manual;
1190 | COMBINE_HIDPI_IMAGES = YES;
1191 | DEFINES_MODULE = YES;
1192 | DEVELOPMENT_TEAM = "";
1193 | DYLIB_COMPATIBILITY_VERSION = 1;
1194 | DYLIB_CURRENT_VERSION = 1;
1195 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1196 | FRAMEWORK_VERSION = A;
1197 | INFOPLIST_FILE = Configs/AGString.plist;
1198 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1199 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1200 | LD_RUNPATH_SEARCH_PATHS = (
1201 | "$(inherited)",
1202 | "@executable_path/../Frameworks",
1203 | "@loader_path/Frameworks",
1204 | );
1205 | MACOSX_DEPLOYMENT_TARGET = 10.10;
1206 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-macOS";
1207 | PRODUCT_NAME = AGString;
1208 | PROVISIONING_PROFILE_SPECIFIER = "";
1209 | SDKROOT = macosx;
1210 | SKIP_INSTALL = YES;
1211 | SWIFT_VERSION = 5.0;
1212 | };
1213 | name = Release;
1214 | };
1215 | 3D9C42FA2274604A000A6585 /* Debug */ = {
1216 | isa = XCBuildConfiguration;
1217 | buildSettings = {
1218 | CODE_SIGN_STYLE = Automatic;
1219 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1220 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1221 | LD_RUNPATH_SEARCH_PATHS = (
1222 | "$(inherited)",
1223 | "@executable_path/Frameworks",
1224 | "@loader_path/Frameworks",
1225 | );
1226 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-iOSTests";
1227 | PRODUCT_NAME = "$(TARGET_NAME)";
1228 | SWIFT_VERSION = 5.0;
1229 | TARGETED_DEVICE_FAMILY = "1,2";
1230 | };
1231 | name = Debug;
1232 | };
1233 | 3D9C42FB2274604A000A6585 /* Release */ = {
1234 | isa = XCBuildConfiguration;
1235 | buildSettings = {
1236 | CODE_SIGN_STYLE = Automatic;
1237 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1238 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1239 | LD_RUNPATH_SEARCH_PATHS = (
1240 | "$(inherited)",
1241 | "@executable_path/Frameworks",
1242 | "@loader_path/Frameworks",
1243 | );
1244 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-iOSTests";
1245 | PRODUCT_NAME = "$(TARGET_NAME)";
1246 | SWIFT_VERSION = 5.0;
1247 | TARGETED_DEVICE_FAMILY = "1,2";
1248 | };
1249 | name = Release;
1250 | };
1251 | 3D9C430A2274611B000A6585 /* Debug */ = {
1252 | isa = XCBuildConfiguration;
1253 | buildSettings = {
1254 | CODE_SIGN_STYLE = Automatic;
1255 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1256 | LD_RUNPATH_SEARCH_PATHS = (
1257 | "$(inherited)",
1258 | "@executable_path/Frameworks",
1259 | "@loader_path/Frameworks",
1260 | );
1261 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-tvOSTests";
1262 | PRODUCT_NAME = "$(TARGET_NAME)";
1263 | SDKROOT = appletvos;
1264 | SWIFT_VERSION = 5.0;
1265 | TARGETED_DEVICE_FAMILY = 3;
1266 | TVOS_DEPLOYMENT_TARGET = 9.0;
1267 | };
1268 | name = Debug;
1269 | };
1270 | 3D9C430B2274611B000A6585 /* Release */ = {
1271 | isa = XCBuildConfiguration;
1272 | buildSettings = {
1273 | CODE_SIGN_STYLE = Automatic;
1274 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1275 | LD_RUNPATH_SEARCH_PATHS = (
1276 | "$(inherited)",
1277 | "@executable_path/Frameworks",
1278 | "@loader_path/Frameworks",
1279 | );
1280 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-tvOSTests";
1281 | PRODUCT_NAME = "$(TARGET_NAME)";
1282 | SDKROOT = appletvos;
1283 | SWIFT_VERSION = 5.0;
1284 | TARGETED_DEVICE_FAMILY = 3;
1285 | TVOS_DEPLOYMENT_TARGET = 9.0;
1286 | };
1287 | name = Release;
1288 | };
1289 | 3D9C431A22746198000A6585 /* Debug */ = {
1290 | isa = XCBuildConfiguration;
1291 | buildSettings = {
1292 | CODE_SIGN_IDENTITY = "-";
1293 | CODE_SIGN_STYLE = Automatic;
1294 | COMBINE_HIDPI_IMAGES = YES;
1295 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1296 | LD_RUNPATH_SEARCH_PATHS = (
1297 | "$(inherited)",
1298 | "@executable_path/../Frameworks",
1299 | "@loader_path/../Frameworks",
1300 | );
1301 | MACOSX_DEPLOYMENT_TARGET = 10.10;
1302 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-macOSTests";
1303 | PRODUCT_NAME = "$(TARGET_NAME)";
1304 | SDKROOT = macosx;
1305 | SWIFT_VERSION = 5.0;
1306 | };
1307 | name = Debug;
1308 | };
1309 | 3D9C431B22746198000A6585 /* Release */ = {
1310 | isa = XCBuildConfiguration;
1311 | buildSettings = {
1312 | CODE_SIGN_IDENTITY = "-";
1313 | CODE_SIGN_STYLE = Automatic;
1314 | COMBINE_HIDPI_IMAGES = YES;
1315 | INFOPLIST_FILE = Configs/AGStringTests.plist;
1316 | LD_RUNPATH_SEARCH_PATHS = (
1317 | "$(inherited)",
1318 | "@executable_path/../Frameworks",
1319 | "@loader_path/../Frameworks",
1320 | );
1321 | MACOSX_DEPLOYMENT_TARGET = 10.10;
1322 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm.AGString-macOSTests";
1323 | PRODUCT_NAME = "$(TARGET_NAME)";
1324 | SDKROOT = macosx;
1325 | SWIFT_VERSION = 5.0;
1326 | };
1327 | name = Release;
1328 | };
1329 | 3D9C43312274629C000A6585 /* Debug */ = {
1330 | isa = XCBuildConfiguration;
1331 | buildSettings = {
1332 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1333 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1334 | CODE_SIGN_STYLE = Manual;
1335 | DEVELOPMENT_TEAM = "";
1336 | INFOPLIST_FILE = Example/Resources/Info.plist;
1337 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1338 | LD_RUNPATH_SEARCH_PATHS = (
1339 | "$(inherited)",
1340 | "@executable_path/Frameworks",
1341 | );
1342 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm-iOS.Example";
1343 | PRODUCT_NAME = "$(TARGET_NAME)";
1344 | PROVISIONING_PROFILE_SPECIFIER = "";
1345 | SWIFT_VERSION = 5.0;
1346 | TARGETED_DEVICE_FAMILY = "1,2";
1347 | };
1348 | name = Debug;
1349 | };
1350 | 3D9C43322274629C000A6585 /* Release */ = {
1351 | isa = XCBuildConfiguration;
1352 | buildSettings = {
1353 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1354 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1355 | CODE_SIGN_STYLE = Manual;
1356 | DEVELOPMENT_TEAM = "";
1357 | INFOPLIST_FILE = Example/Resources/Info.plist;
1358 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1359 | LD_RUNPATH_SEARCH_PATHS = (
1360 | "$(inherited)",
1361 | "@executable_path/Frameworks",
1362 | );
1363 | PRODUCT_BUNDLE_IDENTIFIER = "com.algorithm-iOS.Example";
1364 | PRODUCT_NAME = "$(TARGET_NAME)";
1365 | PROVISIONING_PROFILE_SPECIFIER = "";
1366 | SWIFT_VERSION = 5.0;
1367 | TARGETED_DEVICE_FAMILY = "1,2";
1368 | };
1369 | name = Release;
1370 | };
1371 | /* End XCBuildConfiguration section */
1372 |
1373 | /* Begin XCConfigurationList section */
1374 | 3D9C428A22745894000A6585 /* Build configuration list for PBXProject "AGString" */ = {
1375 | isa = XCConfigurationList;
1376 | buildConfigurations = (
1377 | 3D9C429622745894000A6585 /* Debug */,
1378 | 3D9C429722745894000A6585 /* Release */,
1379 | );
1380 | defaultConfigurationIsVisible = 0;
1381 | defaultConfigurationName = Release;
1382 | };
1383 | 3D9C429822745894000A6585 /* Build configuration list for PBXNativeTarget "AGString-iOS" */ = {
1384 | isa = XCConfigurationList;
1385 | buildConfigurations = (
1386 | 3D9C429922745894000A6585 /* Debug */,
1387 | 3D9C429A22745894000A6585 /* Release */,
1388 | );
1389 | defaultConfigurationIsVisible = 0;
1390 | defaultConfigurationName = Release;
1391 | };
1392 | 3D9C42AE2274599D000A6585 /* Build configuration list for PBXNativeTarget "AGString-tvOS" */ = {
1393 | isa = XCConfigurationList;
1394 | buildConfigurations = (
1395 | 3D9C42AF2274599D000A6585 /* Debug */,
1396 | 3D9C42B02274599D000A6585 /* Release */,
1397 | );
1398 | defaultConfigurationIsVisible = 0;
1399 | defaultConfigurationName = Release;
1400 | };
1401 | 3D9C42BC227459D6000A6585 /* Build configuration list for PBXNativeTarget "AGString-watchOS" */ = {
1402 | isa = XCConfigurationList;
1403 | buildConfigurations = (
1404 | 3D9C42BD227459D6000A6585 /* Debug */,
1405 | 3D9C42BE227459D6000A6585 /* Release */,
1406 | );
1407 | defaultConfigurationIsVisible = 0;
1408 | defaultConfigurationName = Release;
1409 | };
1410 | 3D9C42CA22745A07000A6585 /* Build configuration list for PBXNativeTarget "AGString-macOS" */ = {
1411 | isa = XCConfigurationList;
1412 | buildConfigurations = (
1413 | 3D9C42CB22745A07000A6585 /* Debug */,
1414 | 3D9C42CC22745A07000A6585 /* Release */,
1415 | );
1416 | defaultConfigurationIsVisible = 0;
1417 | defaultConfigurationName = Release;
1418 | };
1419 | 3D9C42F92274604A000A6585 /* Build configuration list for PBXNativeTarget "AGString-iOSTests" */ = {
1420 | isa = XCConfigurationList;
1421 | buildConfigurations = (
1422 | 3D9C42FA2274604A000A6585 /* Debug */,
1423 | 3D9C42FB2274604A000A6585 /* Release */,
1424 | );
1425 | defaultConfigurationIsVisible = 0;
1426 | defaultConfigurationName = Release;
1427 | };
1428 | 3D9C43092274611B000A6585 /* Build configuration list for PBXNativeTarget "AGString-tvOSTests" */ = {
1429 | isa = XCConfigurationList;
1430 | buildConfigurations = (
1431 | 3D9C430A2274611B000A6585 /* Debug */,
1432 | 3D9C430B2274611B000A6585 /* Release */,
1433 | );
1434 | defaultConfigurationIsVisible = 0;
1435 | defaultConfigurationName = Release;
1436 | };
1437 | 3D9C431922746198000A6585 /* Build configuration list for PBXNativeTarget "AGString-macOSTests" */ = {
1438 | isa = XCConfigurationList;
1439 | buildConfigurations = (
1440 | 3D9C431A22746198000A6585 /* Debug */,
1441 | 3D9C431B22746198000A6585 /* Release */,
1442 | );
1443 | defaultConfigurationIsVisible = 0;
1444 | defaultConfigurationName = Release;
1445 | };
1446 | 3D9C43302274629C000A6585 /* Build configuration list for PBXNativeTarget "Example" */ = {
1447 | isa = XCConfigurationList;
1448 | buildConfigurations = (
1449 | 3D9C43312274629C000A6585 /* Debug */,
1450 | 3D9C43322274629C000A6585 /* Release */,
1451 | );
1452 | defaultConfigurationIsVisible = 0;
1453 | defaultConfigurationName = Release;
1454 | };
1455 | /* End XCConfigurationList section */
1456 | };
1457 | rootObject = 3D9C428722745894000A6585 /* Project object */;
1458 | }
1459 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcbaselines/3D9C42F02274604A000A6585.xcbaseline/3385FEE0-D0B1-4658-A4FC-4F5EA707274C.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | classNames
6 |
7 | AGStringTests
8 |
9 | testLtrim()
10 |
11 | com.apple.XCTPerformanceMetric_WallClockTime
12 |
13 | baselineAverage
14 | 0.000151
15 | baselineIntegrationDisplayName
16 | Local Baseline
17 |
18 |
19 | testOccurence()
20 |
21 | com.apple.XCTPerformanceMetric_WallClockTime
22 |
23 | baselineAverage
24 | 0.0128
25 | baselineIntegrationDisplayName
26 | Local Baseline
27 |
28 |
29 | testRtrim()
30 |
31 | com.apple.XCTPerformanceMetric_WallClockTime
32 |
33 | baselineAverage
34 | 0.000108
35 | baselineIntegrationDisplayName
36 | Local Baseline
37 |
38 |
39 | testTrim()
40 |
41 | com.apple.XCTPerformanceMetric_WallClockTime
42 |
43 | baselineAverage
44 | 4.48e-05
45 | baselineIntegrationDisplayName
46 | Local Baseline
47 |
48 |
49 | testltrim()
50 |
51 | com.apple.XCTPerformanceMetric_WallClockTime
52 |
53 | baselineAverage
54 | 0.00017564
55 | baselineIntegrationDisplayName
56 | Local Baseline
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcbaselines/3D9C42F02274604A000A6585.xcbaseline/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | runDestinationsByUUID
6 |
7 | 3385FEE0-D0B1-4658-A4FC-4F5EA707274C
8 |
9 | localComputer
10 |
11 | busSpeedInMHz
12 | 100
13 | cpuCount
14 | 1
15 | cpuKind
16 | Quad-Core Intel Core i7
17 | cpuSpeedInMHz
18 | 2200
19 | logicalCPUCoresPerPackage
20 | 8
21 | modelCode
22 | MacBookPro11,2
23 | physicalCPUCoresPerPackage
24 | 4
25 | platformIdentifier
26 | com.apple.platform.macosx
27 |
28 | targetArchitecture
29 | x86_64
30 | targetDevice
31 |
32 | modelCode
33 | iPhone12,5
34 | platformIdentifier
35 | com.apple.platform.iphonesimulator
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcschemes/AGString-iOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
36 |
42 |
43 |
44 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
67 |
68 |
74 |
75 |
76 |
77 |
78 |
79 |
85 |
86 |
92 |
93 |
94 |
95 |
97 |
98 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcschemes/AGString-macOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
36 |
42 |
43 |
44 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
67 |
68 |
74 |
75 |
76 |
77 |
78 |
79 |
85 |
86 |
92 |
93 |
94 |
95 |
97 |
98 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcschemes/AGString-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
36 |
42 |
43 |
44 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
67 |
68 |
74 |
75 |
76 |
77 |
78 |
79 |
85 |
86 |
92 |
93 |
94 |
95 |
97 |
98 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/AGString.xcodeproj/xcshareddata/xcschemes/AGString-watchOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
46 |
47 |
53 |
54 |
55 |
56 |
57 |
58 |
64 |
65 |
71 |
72 |
73 |
74 |
76 |
77 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/Configs/AGString.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | AGString
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(CURRENT_PROJECT_VERSION)
25 | NSHumanReadableCopyright
26 | Copyright © 2019 AGString. All rights reserved.
27 | NSPrincipalClass
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Configs/AGStringTests.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Example
4 | //
5 | // Created by AGString on 2019. 11. 3..
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - AppDelegate
12 |
13 | /// The AppDelegate
14 | @UIApplicationMain
15 | class AppDelegate: UIResponder, UIApplicationDelegate {
16 |
17 | /// The UIWindow
18 | var window: UIWindow?
19 |
20 | /// The RootViewController
21 | var rootViewController: UIViewController {
22 | return UIViewController()
23 | }
24 |
25 | /// Application did finish launching with options
26 | ///
27 | /// - Parameters:
28 | /// - application: The UIApplication
29 | /// - launchOptions: The LaunchOptions
30 | /// - Returns: The launch result
31 | func application(_ application: UIApplication,
32 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
33 | // Initialize UIWindow
34 | self.window = .init(frame: UIScreen.main.bounds)
35 | // Set RootViewController
36 | self.window?.rootViewController = self.rootViewController
37 | // Make Key and Visible
38 | self.window?.makeKeyAndVisible()
39 | // Return positive launch
40 | return true
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "idiom" : "ios-marketing",
113 | "size" : "1024x1024",
114 | "scale" : "1x"
115 | }
116 | ],
117 | "info" : {
118 | "version" : 1,
119 | "author" : "xcode"
120 | }
121 | }
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Example/Resources/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/Resources/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | AGString
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 AGString
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.0
2 |
3 | import PackageDescription
4 |
5 | let package = Package(
6 | name: "AGString",
7 | platforms: [
8 | .iOS(.v8),
9 | .tvOS(.v9),
10 | .watchOS(.v2),
11 | .macOS(.v10_10)
12 | ],
13 | products: [
14 | .library(
15 | name: "AGString",
16 | targets: ["AGString"]
17 | ),
18 | ],
19 | dependencies: [],
20 | targets: [
21 | .target(
22 | name: "AGString",
23 | dependencies: [],
24 | path: "Sources"
25 | ),
26 | .testTarget(
27 | name: "AGStringTests",
28 | dependencies: ["AGString"],
29 | path: "Tests"
30 | ),
31 | ]
32 | )
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | 
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | # AGString
33 |
34 | AGString is an extension for convenient working with swift String.
35 |
36 |
37 | AGRegex is Wrapper of NSRegularExpression. It gives an easy and iterative way to use RegularExpression.
38 |
39 |
40 | ## Features
41 | - AGString gives 'String type' to 'Int-Index' based referencing
42 |
43 | * :white_check_mark: Get Character object with Int index
44 | * :white_check_mark: Get substring object with Range
45 | * :white_check_mark: String utility methods(zfill, countOccurence, ltrim,rtrim ...)
46 |
47 | - AGRegex
48 |
49 | * :white_check_mark: Provide NSRange extension for String
50 | * :white_check_mark: Get All Match Result as AGMatch structure.
51 | * :white_check_mark: Support iterative way to use match result
52 | * :white_check_mark: Substitute matched string to other string
53 |
54 | ## Example
55 | The example application is the best way to see `AGString` in action. Simply open the `AGString.xcodeproj` and run the `Example` scheme.
56 | ## Installation
57 | ### CocoaPods
58 | AGString is available through [CocoaPods](http://cocoapods.org). To install
59 | it, simply add the following line to your Podfile:
60 | ```bash
61 | pod 'AGString'
62 | ```
63 | ### Carthage
64 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
65 | To integrate AGString into your Xcode project using Carthage, specify it in your `Cartfile`:
66 | ```ogdl
67 | github "SwiftAlgorithmClub/AGString"
68 | ```
69 | Run `carthage update` to build the framework and drag the built `AGString.framework` into your Xcode project.
70 | On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase” and add the Framework path as mentioned in [Carthage Getting started Step 4, 5 and 6](https://github.com/Carthage/Carthage/blob/master/README.md#if-youre-building-for-ios-tvos-or-watchos)
71 | ## AGString Usage
72 | ### Slicing
73 | ```swift
74 | var str = "Hello, World!"
75 | str[1..<3] // "el"
76 | str[7...9] // "Wor"
77 | str[7...] // "World!"
78 | str[..<5] // "Hello"
79 | str[...5] // "Hello,"
80 | ```
81 | ### CharAt
82 | ```swift
83 | var str = "Hello, World!"
84 | str[1] // "e"
85 | ```
86 | ### Trim
87 | ```swift
88 | " abcd ".trimLeft()
89 | // "abcd "
90 | " abcd ".trimRight()
91 | // " abcd"
92 | " abcd ".trim()
93 | //"abcd"
94 | ```
95 | ### WordCount
96 | ```swift
97 | let str = "like in like"
98 | str.occurence(of: "like") // 2
99 | ```
100 | ### Zfill
101 | ```swift
102 | let str = "abc"
103 | str.zfill(10) // "0000000abc"
104 | str.zfill(10, with: "1", direction: .right) // "abc1111111"
105 | ```
106 | ## AGRegex Usage
107 | ### FindAll
108 | ```swift
109 | let r = try! NSRegularExpression(pattern: "ai", options: [])
110 | let regex = AGRegex(r)
111 | regex.findAll("The rain in Spain")
112 | /*
113 | [
114 | AGMatch(start: 5, end: 7, base: str, groups: ["ai"]),
115 | AGMatch(start: 14, end: 16, base: str, groups: ["ai"]),
116 | ]
117 | */
118 | ```
119 | ### First
120 | ```swift
121 | let r = try! NSRegularExpression(pattern: "ai", options: [])
122 | let regex = AGRegex(r)
123 | regex.first("The rain in Spain")
124 | // AGMatch(start: 5, end: 7, base: str, groups: ["ai"])
125 | ```
126 | ### Last
127 | ```swift
128 | let r = try! NSRegularExpression(pattern: "ai", options: [])
129 | let regex = AGRegex(r)
130 | regex.last("The rain in Spain")
131 | // AGMatch(start: 14, end: 16, base: str, groups: ["ai"])
132 | ```
133 | ### Sub
134 | ```swift
135 | let r = try! NSRegularExpression(pattern: "ai", options: [])
136 | let regex = AGRegex(r)
137 | regex.last("The rain in Spain")
138 | // AGMatch(start: 14, end: 16, base: str, groups: ["ai"])
139 | let r = try! NSRegularExpression(pattern: "\\s", options: [])
140 | let regex = AGRegex(r)
141 | regex.sub(str: "The rain in Spain", replace: "9")
142 | // The9rain9in9Spain
143 | regex.sub(str: str, replace: "9", count: 2)
144 | subWithCount == "The9rain9in Spain"
145 | // "The9rain9in Spain"
146 | ```
147 | ### FindIter
148 | ```swift
149 | let r = try! NSRegularExpression(pattern: "([A-Z]+)([0-9]+)", options: [])
150 | let regex = AGRegex(r)
151 | for m in regex.finditer("ABC12DEF3G56HIJ7") {
152 | print("\(m.group(2)) * \(m.group(1))")
153 | }
154 | /*
155 | "12 * ABC",
156 | "3 * DEF",
157 | "56 * G",
158 | "7 * HIJ"
159 | */
160 | ```
161 | ## Contributing
162 | Contributions are very welcome 🙌
163 | ## License
164 | AGString is released under the MIT license. See LICENSE for details.
165 |
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Resources/AppIcon/android/playstore-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/android/playstore-icon.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-27x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-27x20@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-27x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-27x20@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-27x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-27x20@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-iPadAir-67x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-iPadAir-67x50@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-iPadAir-74x55@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-iPadAir-74x55@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-iPhone-60x45@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-app-store-1024x768.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-app-store-1024x768.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/imessenger/icon-messages-transcript-32x24@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images":[
3 | {
4 | "idiom":"iphone",
5 | "size":"20x20",
6 | "scale":"2x",
7 | "filename":"Icon-App-20x20@2x.png"
8 | },
9 | {
10 | "idiom":"iphone",
11 | "size":"20x20",
12 | "scale":"3x",
13 | "filename":"Icon-App-20x20@3x.png"
14 | },
15 | {
16 | "idiom":"iphone",
17 | "size":"29x29",
18 | "scale":"1x",
19 | "filename":"Icon-App-29x29@1x.png"
20 | },
21 | {
22 | "idiom":"iphone",
23 | "size":"29x29",
24 | "scale":"2x",
25 | "filename":"Icon-App-29x29@2x.png"
26 | },
27 | {
28 | "idiom":"iphone",
29 | "size":"29x29",
30 | "scale":"3x",
31 | "filename":"Icon-App-29x29@3x.png"
32 | },
33 | {
34 | "idiom":"iphone",
35 | "size":"40x40",
36 | "scale":"2x",
37 | "filename":"Icon-App-40x40@2x.png"
38 | },
39 | {
40 | "idiom":"iphone",
41 | "size":"40x40",
42 | "scale":"3x",
43 | "filename":"Icon-App-40x40@3x.png"
44 | },
45 | {
46 | "idiom":"iphone",
47 | "size":"60x60",
48 | "scale":"2x",
49 | "filename":"Icon-App-60x60@2x.png"
50 | },
51 | {
52 | "idiom":"iphone",
53 | "size":"60x60",
54 | "scale":"3x",
55 | "filename":"Icon-App-60x60@3x.png"
56 | },
57 | {
58 | "idiom":"iphone",
59 | "size":"76x76",
60 | "scale":"2x",
61 | "filename":"Icon-App-76x76@2x.png"
62 | },
63 | {
64 | "idiom":"ipad",
65 | "size":"20x20",
66 | "scale":"1x",
67 | "filename":"Icon-App-20x20@1x.png"
68 | },
69 | {
70 | "idiom":"ipad",
71 | "size":"20x20",
72 | "scale":"2x",
73 | "filename":"Icon-App-20x20@2x.png"
74 | },
75 | {
76 | "idiom":"ipad",
77 | "size":"29x29",
78 | "scale":"1x",
79 | "filename":"Icon-App-29x29@1x.png"
80 | },
81 | {
82 | "idiom":"ipad",
83 | "size":"29x29",
84 | "scale":"2x",
85 | "filename":"Icon-App-29x29@2x.png"
86 | },
87 | {
88 | "idiom":"ipad",
89 | "size":"40x40",
90 | "scale":"1x",
91 | "filename":"Icon-App-40x40@1x.png"
92 | },
93 | {
94 | "idiom":"ipad",
95 | "size":"40x40",
96 | "scale":"2x",
97 | "filename":"Icon-App-40x40@2x.png"
98 | },
99 | {
100 | "idiom":"ipad",
101 | "size":"76x76",
102 | "scale":"1x",
103 | "filename":"Icon-App-76x76@1x.png"
104 | },
105 | {
106 | "idiom":"ipad",
107 | "size":"76x76",
108 | "scale":"2x",
109 | "filename":"Icon-App-76x76@2x.png"
110 | },
111 | {
112 | "idiom":"ipad",
113 | "size":"83.5x83.5",
114 | "scale":"2x",
115 | "filename":"Icon-App-83.5x83.5@2x.png"
116 | },
117 | {
118 | "size" : "1024x1024",
119 | "idiom" : "ios-marketing",
120 | "scale" : "1x",
121 | "filename" : "ItunesArtwork@2x.png"
122 | }
123 | ],
124 | "info":{
125 | "version":1,
126 | "author":"makeappicon"
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/AppIcon.appiconset/ItunesArtwork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/AppIcon.appiconset/ItunesArtwork@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/README.md:
--------------------------------------------------------------------------------
1 | ## iTunesArtwork & iTunesArtwork@2x (App Icon) file extension:
2 |
3 | PNG extension is prepended to these two files -
4 |
5 | While Apple suggested to omit the extension for these files,
6 | the '.png' extension is actually required for iTunesConnect submission.
7 |
8 | This is done for you so you don't have to.
9 |
10 | However, for Ad_hoc or Enterprise distirbution, the extension should be removed
11 | from the files before adding to XCode to avoid error.
12 |
13 | refs: https://developer.apple.com/library/ios/qa/qa1686/_index.html
14 |
15 | ## iTunesArtwork & iTunesArtwork@2x (App Icon) transparency handling:
16 |
17 | As images with alpha channels or transparencies cannot be set as an application's icon on
18 | iTunesConnect, all transparent pixels in your images will be converted into
19 | solid blacks.
20 |
21 | To achieve the best result, you're advised to adjust the transparency settings
22 | in your source files before converting them with makeAppIcon.
23 |
24 | refs: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/AppIcons.html
25 |
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/iTunesArtwork@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/iTunesArtwork@1x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/iTunesArtwork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/iTunesArtwork@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/ios/iTunesArtwork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/ios/iTunesArtwork@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images":[
3 | {
4 | "size":"24x24",
5 | "idiom":"watch",
6 | "scale":"2x",
7 | "filename":"Icon-24@2x.png",
8 | "role":"notificationCenter",
9 | "subtype":"38mm"
10 | },
11 | {
12 | "size":"27.5x27.5",
13 | "idiom":"watch",
14 | "scale":"2x",
15 | "filename":"Icon-27.5@2x.png",
16 | "role":"notificationCenter",
17 | "subtype":"42mm"
18 | },
19 | {
20 | "size":"29x29",
21 | "idiom":"watch",
22 | "scale":"2x",
23 | "filename":"Icon-29@2x.png",
24 | "role":"companionSettings"
25 | },
26 | {
27 | "size":"29x29",
28 | "idiom":"watch",
29 | "scale":"3x",
30 | "filename":"Icon-29@3x.png",
31 | "role":"companionSettings"
32 | },
33 | {
34 | "size":"40x40",
35 | "idiom":"watch",
36 | "scale":"2x",
37 | "filename":"Icon-40@2x.png",
38 | "role":"appLauncher",
39 | "subtype":"38mm"
40 | },
41 | {
42 | "size":"44x44",
43 | "idiom":"watch",
44 | "scale":"2x",
45 | "filename":"Icon-44@2x.png",
46 | "role":"longLook",
47 | "subtype":"42mm"
48 | },
49 | {
50 | "size":"86x86",
51 | "idiom":"watch",
52 | "scale":"2x",
53 | "filename":"Icon-86@2x.png",
54 | "role":"quickLook",
55 | "subtype":"38mm"
56 | },
57 | {
58 | "size":"98x98",
59 | "idiom":"watch",
60 | "scale":"2x",
61 | "filename":"Icon-98@2x.png",
62 | "role":"quickLook",
63 | "subtype":"42mm"
64 | }
65 | ],
66 | "info":{
67 | "version":1,
68 | "author":"makeappicon"
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-24@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-24@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-27.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-27.5@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-29@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-29@3x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-40@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-44@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-44@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-86@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-86@2x.png
--------------------------------------------------------------------------------
/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-98@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/Resources/AppIcon/watchkit/AppIcon.appiconset/Icon-98@2x.png
--------------------------------------------------------------------------------
/Sources/Regex/AGMatch.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGMatch.swift
3 | // AGString-iOS
4 | //
5 | // Created by tskim on 2019/11/04.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public typealias AGSpan = NSRange
12 |
13 | public struct AGMatch: Equatable {
14 | let start: Int
15 | let end: Int
16 | private let groups: [String]
17 |
18 | public init(start: Int, end: Int, base: String, groups: [String]) {
19 | self.start = start
20 | self.end = end
21 | self.groups = groups
22 | }
23 | }
24 |
25 | extension AGMatch {
26 | public var groupCount: Int {
27 | return groups.count
28 | }
29 |
30 | public func group(_ index: Int = 0) -> String {
31 | guard index < groups.count else {
32 | return ""
33 | }
34 |
35 | return groups[index]
36 | }
37 |
38 | public var span: AGSpan {
39 | return NSRange(location: start, length: start + end)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Sources/Regex/AGMatchLazyList.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGMatchLazyList.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/11.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct AGMatchLazyList: Equatable, Sequence {
12 | public typealias Iterator = AGMatchLazyListIterator
13 | public typealias Element = AGMatch
14 |
15 | public let baseString: String
16 | private let regex: NSRegularExpression
17 |
18 | init(base: String, regex: NSRegularExpression) {
19 | self.baseString = base
20 | self.regex = regex
21 | }
22 |
23 | public __consuming func makeIterator() -> AGMatchLazyList.Iterator {
24 | return AGMatchLazyListIterator(base: baseString,
25 | regex: self.regex)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sources/Regex/AGMatchLazyListIterator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGMatchLazyListIterator.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/11.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct AGMatchLazyListIterator: IteratorProtocol {
12 | public typealias Element = AGMatch
13 |
14 | private let baseString: String
15 | private let regex: NSRegularExpression
16 | private var offset: Int = 0
17 |
18 | public mutating func next() -> AGMatch? {
19 | guard let matched = regex.firstMatch(
20 | in: baseString,
21 | options: [],
22 | range: NSRange(location: offset, length: baseString.count - offset))
23 | else { return nil }
24 |
25 | var group: [String] = []
26 |
27 | for index in 0 ..< matched.numberOfRanges {
28 | let interpolated = NSRange(
29 | location: matched.range(at: index).lowerBound,
30 | length: matched.range(at: index).length)
31 |
32 | group.append(baseString[interpolated])
33 | }
34 |
35 | let result = AGMatch(
36 | start: matched.range.lowerBound,
37 | end: matched.range.upperBound,
38 | base: baseString,
39 | groups: group)
40 |
41 | self.offset = matched.range.upperBound
42 |
43 | return result
44 | }
45 |
46 | init(base: String, regex: NSRegularExpression) {
47 | self.baseString = base
48 | self.regex = regex
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Sources/Regex/AGMatchList.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGMatchList.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/10.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct AGMatchList: Equatable, Sequence {
12 | public typealias Iterator = AGMatchListIterator
13 | public typealias Element = AGMatch
14 |
15 | public let baseString: String
16 | private let list: [Element]
17 |
18 | init(base: String, matching matchList: [Element]) {
19 | baseString = base
20 | list = matchList
21 | }
22 |
23 | public var first: AGMatch? {
24 | return list.first
25 | }
26 |
27 | public var last: AGMatch? {
28 | return list.last
29 | }
30 |
31 | public __consuming func makeIterator() -> AGMatchList.Iterator {
32 | return AGMatchListIterator(list.makeIterator())
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Sources/Regex/AGMatchListIterator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGMatchIterator.swift
3 | // AGString-iOS
4 | //
5 | // Created by tskim on 2019/11/04.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct AGMatchListIterator: IteratorProtocol {
12 | public typealias Element = AGMatch
13 |
14 | var iterator: IndexingIterator<[AGMatch]>
15 | public mutating func next() -> AGMatch? {
16 | return iterator.next()
17 | }
18 |
19 | init(_ iterator: IndexingIterator<[AGMatch]>) {
20 | self.iterator = iterator
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/Regex/AGRegex.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGRegex.swift
3 | // AGString-iOS
4 | //
5 | // Created by tskim on 2019/11/03.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | @_exported import Foundation
10 |
11 | public class AGRegex {
12 |
13 | private var regex: NSRegularExpression
14 |
15 | public init(_ regex: NSRegularExpression) {
16 | self.regex = regex
17 | }
18 | }
19 |
20 | extension AGRegex {
21 |
22 | public func makeMatchList(_ str: String,
23 | options: NSRegularExpression.MatchingOptions = [])
24 | -> AGMatchList {
25 | let matched = regex.matches(
26 | in: str,
27 | options: options,
28 | range: NSRange(location: 0, length: str.count))
29 | let mapped: [AGMatch] = matched.map {
30 | var group: [String] = []
31 |
32 | for index in 0 ..< $0.numberOfRanges {
33 | group.append(str[$0.range(at: index)])
34 | }
35 |
36 | return AGMatch(start: $0.range.lowerBound,
37 | end: $0.range.upperBound,
38 | base: str,
39 | groups: group)
40 | }
41 |
42 | return AGMatchList(base: str, matching: mapped)
43 | }
44 |
45 | public func sub(str: String, replace: String, count: Int = Int.max) -> String {
46 | var result = str
47 | var replacingCount = count
48 |
49 | while replacingCount > 0, let matched = regex.firstMatch(
50 | in: result,
51 | options: [],
52 | range: NSRange(location: 0, length: result.count)) {
53 | result.replaceSubrange(
54 | result.range(with: matched.range),
55 | with: replace)
56 | replacingCount -= 1
57 | }
58 |
59 | return result
60 | }
61 |
62 | public func makeMatchStream(_ str: String,
63 | option: NSRegularExpression.MatchingOptions = [])
64 | -> AGMatchLazyList {
65 | return AGMatchLazyList(base: str, regex: self.regex)
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Sources/Regex/String+NSRange.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+NSRange.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/06.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension String {
12 | public func range(with range: NSRange) -> Range {
13 | let begin = index(startIndex, offsetBy: range.location)
14 | let end = index(startIndex, offsetBy: range.location + range.length)
15 | return begin.. String {
19 | return String(self[self.range(with: range)])
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/String/AGString.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGString.swift
3 | // AGString
4 | //
5 | // Created by AGString on 2019. 11. 3..
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | // Include Foundation
10 | @_exported import Foundation
11 |
--------------------------------------------------------------------------------
/Sources/String/StringIndex.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringIndex.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/03.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension String {
12 | public subscript(index: Int) -> Character {
13 | set {
14 | let begin = self.index(startIndex, offsetBy: index)
15 | let end = self.index(begin, offsetBy: 1)
16 | self.replaceSubrange(begin ..< end, with: [newValue])
17 | }
18 | get {
19 | return self[self.index(self.startIndex, offsetBy: index)]
20 | }
21 | }
22 |
23 | public subscript(bounds: CountableRange) -> String {
24 | set {
25 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
26 | let end = index(startIndex, offsetBy: bounds.upperBound)
27 |
28 | self.replaceSubrange(begin ..< end, with: newValue)
29 | }
30 | get {
31 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
32 | let end = index(startIndex, offsetBy: bounds.upperBound)
33 |
34 | return String(self[begin ..< end])
35 | }
36 | }
37 |
38 | public subscript(bounds: CountableClosedRange) -> String {
39 | set {
40 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
41 | let end = index(startIndex, offsetBy: bounds.upperBound)
42 |
43 | self.replaceSubrange(begin ... end, with: newValue)
44 | }
45 | get {
46 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
47 | let end = index(startIndex, offsetBy: bounds.upperBound)
48 |
49 | return String(self[begin ... end])
50 | }
51 | }
52 |
53 | public subscript(bounds: CountablePartialRangeFrom) -> String {
54 | set {
55 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
56 |
57 | self.replaceSubrange(begin ..< endIndex, with: newValue)
58 | }
59 | get {
60 | let begin = index(startIndex, offsetBy: bounds.lowerBound)
61 |
62 | return String(self[begin ..< endIndex])
63 | }
64 | }
65 |
66 | public subscript(bounds: PartialRangeThrough) -> String {
67 | set {
68 | let end = index(startIndex, offsetBy: bounds.upperBound)
69 |
70 | self.replaceSubrange(startIndex ... end, with: newValue)
71 | }
72 | get {
73 | let end = index(startIndex, offsetBy: bounds.upperBound)
74 |
75 | return String(self[startIndex ... end])
76 | }
77 | }
78 |
79 | public subscript(bounds: PartialRangeUpTo) -> String {
80 | set {
81 | let end = index(startIndex, offsetBy: bounds.upperBound)
82 |
83 | self.replaceSubrange(startIndex ..< end, with: newValue)
84 | }
85 | get {
86 | let end = index(startIndex, offsetBy: bounds.upperBound)
87 |
88 | return String(self[startIndex ..< end])
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/Sources/String/Utility.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Utility.swift
3 | // AGString-iOS
4 | //
5 | // Created by 조수환 on 2019/11/03.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: - ZFill
12 | extension String {
13 | public enum ZFillDirection {
14 | case left
15 | case right
16 | }
17 | public func zfill(_ length: Int, with character: Character = "0", direction dir: ZFillDirection = .left) -> String {
18 | let lengthToNeed = length - self.count
19 |
20 | if lengthToNeed <= 0 {
21 | return self
22 | } else {
23 |
24 | let str = String(repeating: character, count: lengthToNeed)
25 | switch dir {
26 | case .left:
27 | return str + self
28 | case .right:
29 | return self + str
30 | }
31 | }
32 | }
33 |
34 | }
35 |
36 | // MARK: - occurence counting
37 | extension String {
38 |
39 | public func occurence(of str: String) -> Int {
40 | let length = self.count
41 | let strLength = str.count
42 |
43 | var result = 0
44 |
45 | // partial[i] = N의 길이가 i인 접두사의 접두사도 되고 접미사도 되는 문자열의 최대 길이
46 | let partial: [Int] = str.partial()
47 |
48 | var begin = 0
49 | var matched = 0
50 |
51 | while begin <= length - strLength {
52 | let hIndex = self.index(self.startIndex, offsetBy: begin+matched)
53 | let nIndex = str.index(self.startIndex, offsetBy: matched)
54 |
55 | if matched < strLength, self[hIndex] == str[nIndex] {
56 | matched += 1
57 |
58 | if matched == strLength {
59 | result += 1
60 | }
61 | } else {
62 | if matched == 0 {
63 | begin += 1
64 | } else {
65 | begin += (matched - partial[matched - 1])
66 |
67 | matched = partial[matched - 1]
68 | }
69 | }
70 | }
71 |
72 | return result
73 | }
74 |
75 | fileprivate func partial() -> [Int] {
76 | let length = self.count
77 | var result = Array(repeating: 0, count: length)
78 |
79 | var begin = 1
80 | var matched = 0
81 |
82 | while begin + matched < length {
83 | let postfixIndex = self.index(startIndex, offsetBy: begin + matched)
84 | let prefixIndex = self.index(startIndex, offsetBy: matched)
85 |
86 | if self[prefixIndex] == self[postfixIndex] {
87 | matched += 1
88 | result[begin + matched - 1] = matched
89 | } else {
90 | if matched == 0 {
91 | begin += 1
92 | } else {
93 | begin += matched - result[matched - 1]
94 | matched = result[matched - 1]
95 | }
96 | }
97 | }
98 |
99 | return result
100 | }
101 | }
102 |
103 | // MARK: - trimming(left,right,both)
104 | extension String {
105 | public func trimLeft() -> String {
106 | if self.isEmpty {
107 | return ""
108 | }
109 |
110 | var cursor = 0
111 |
112 | while cursor < self.count, self[cursor].isWhitespace {
113 | cursor += 1
114 | }
115 |
116 | if cursor == self.count {
117 | return ""
118 | } else {
119 | return self[cursor...]
120 | }
121 | }
122 |
123 | public func trimRight() -> String {
124 | if self.isEmpty {
125 | return ""
126 | }
127 |
128 | var cursor = self.count-1
129 |
130 | while cursor >= 0, self[cursor].isWhitespace {
131 | cursor -= 1
132 | }
133 |
134 | if cursor < 0 {
135 | return ""
136 | } else {
137 | return self[...cursor]
138 | }
139 | }
140 |
141 | public func trim() -> String {
142 | return self.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
143 | }
144 | }
145 |
146 | // MARK: - Slicing using characters
147 |
148 | extension String {
149 |
150 | /// Returns a sliced string of given string
151 | /// from the first `start` character to the last `end` character.
152 | ///
153 | /// If the lower bound is greater than the upper bound, it returns an empty string.
154 | /// If the given string doesn't contain given characters, it also returns an empty string.
155 | ///
156 | /// - Parameters:
157 | /// - start: The character value being the lower bound of the given string.
158 | /// - end: The character value being the upper bound of the given string.
159 | /// - inversed: A boolean value that indicates whether the sliced string is inversed.
160 | /// The Default value is `false`.
161 | ///
162 | /// - Returns: A sliced string of given string.
163 | public func sliced(from start: Character, to end: Character, inversed: Bool = false) -> String {
164 | guard let startCharacterIndex = firstIndex(of: start),
165 | let endCharacterIndex = lastIndex(of: end),
166 | startCharacterIndex <= endCharacterIndex
167 | else { return "" }
168 | let slicedSubstring = self[startCharacterIndex ... endCharacterIndex]
169 | return !inversed ? String(slicedSubstring) : String(slicedSubstring.reversed())
170 | }
171 |
172 | /// Slices a given string
173 | /// from the first `start` character to the last `end` character.
174 | ///
175 | /// If the lower bound is greater than the upper bound, it becomes an empty string.
176 | /// If the given string doesn't contain given characters, it also becomes an emtpy string.
177 | ///
178 | /// - Parameters:
179 | /// - start: The character value being the lower bound of the given string.
180 | /// - end: The character value being the upper bound of the given string.
181 | /// - inversed: A boolean value that indicates whether the sliced string is inversed.
182 | /// The Default value is `false`.
183 | public mutating func slice(from start: Character, to end: Character, inversed: Bool = false) {
184 | guard let startCharacterIndex = firstIndex(of: start),
185 | let endCharacterIndex = lastIndex(of: end),
186 | startCharacterIndex <= endCharacterIndex else {
187 | self = ""
188 | return
189 | }
190 | let slicedSubstring = self[startCharacterIndex ... endCharacterIndex]
191 | self = !inversed ? String(slicedSubstring) : String(slicedSubstring.reversed())
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/Tests/AGRegexTest.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGRegexTest.swift
3 | // AGString-iOS
4 | //
5 | // Created by tskim on 2019/11/04.
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 |
10 | @testable import AGString
11 | import XCTest
12 |
13 | class AGRegexTest: XCTestCase {
14 |
15 | func testFindAll() {
16 | let r = try! NSRegularExpression(pattern: "ai", options: [])
17 | let regex = AGRegex(r)
18 | let str = "The rain in Spain"
19 | let actual = regex.makeMatchList(str)
20 | let expect = AGMatchList(base: str, matching: [
21 | AGMatch(start: 5, end: 7, base: str, groups: ["ai"]),
22 | AGMatch(start: 14, end: 16, base: str, groups: ["ai"]),
23 | ])
24 |
25 | XCTAssertEqual(actual, expect)
26 | }
27 |
28 | func testFirstMatch() {
29 | let r = try! NSRegularExpression(pattern: "ai", options: [])
30 | let regex = AGRegex(r)
31 | let str = "The rain in Spain"
32 | let actual = regex.makeMatchList(str).first
33 | let expect = AGMatch(start: 5, end: 7, base: str, groups: ["ai"])
34 | XCTAssertEqual(actual, expect)
35 | }
36 |
37 | func testLastMatch() {
38 | let r = try! NSRegularExpression(pattern: "ai", options: [])
39 | let regex = AGRegex(r)
40 | let str = "The rain in Spain"
41 | let actual = regex.makeMatchList(str).last
42 | let expect = AGMatch(start: 14, end: 16, base: str, groups: ["ai"])
43 | XCTAssertEqual(actual, expect)
44 | }
45 |
46 | func testSub() {
47 | let r = try! NSRegularExpression(pattern: "\\s", options: [])
48 | let regex = AGRegex(r)
49 | let str = "The rain in Spain"
50 | let actual = regex.sub(str: str, replace: "9")
51 | let expect = "The9rain9in9Spain"
52 | XCTAssertEqual(actual, expect)
53 | }
54 |
55 | func testSubWithCount() {
56 | let r = try! NSRegularExpression(pattern: "\\s", options: [])
57 | let regex = AGRegex(r)
58 | let str = "The rain in Spain"
59 | let actual = regex.sub(str: str, replace: "9", count: 2)
60 | let expect = "The9rain9in Spain"
61 | XCTAssertEqual(actual, expect)
62 | }
63 |
64 | func testLazyMatch() {
65 | let r = try! NSRegularExpression(pattern: "([A-Z]+)([0-9]+)", options: [])
66 | let regex = AGRegex(r)
67 | let str = "ABC12DEF3G56HIJ7"
68 |
69 |
70 | let expects = [
71 | "12 * ABC",
72 | "3 * DEF",
73 | "56 * G",
74 | "7 * HIJ"
75 | ]
76 |
77 | var actuals: [String] = []
78 |
79 | for m in regex.makeMatchStream(str) {
80 | let actual = "\(m.group(2)) * \(m.group(1))"
81 | actuals.append(actual)
82 | }
83 |
84 | XCTAssertEqual(actuals, expects)
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Tests/AGStringTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AGStringTests.swift
3 | // AGStringTests
4 | //
5 | // Created by AGString on 2019. 11. 3..
6 | // Copyright © 2019 AGString. All rights reserved.
7 | //
8 |
9 | @testable import AGString
10 | import XCTest
11 |
12 | class AGStringTests: XCTestCase {
13 |
14 | static var allTests = [
15 | ("testExample", testExample),
16 | ]
17 |
18 | func testExample() {
19 | var str = "Hello, World!"
20 |
21 | XCTAssert(str[1] == "e")
22 | XCTAssert(str[1..<3] == "el")
23 | XCTAssert(str[7...9] == "Wor")
24 | XCTAssert(str[7...] == "World!")
25 | XCTAssert(str[..<5] == "Hello")
26 | XCTAssert(str[...5] == "Hello,")
27 |
28 | str[1] = "a"
29 | XCTAssert(str == "Hallo, World!")
30 |
31 | str[1..<6] = "uge"
32 | XCTAssert(str == "Huge World!")
33 |
34 | str[5...7] = "Go"
35 | XCTAssert(str == "Huge Gold!")
36 |
37 | str[9...] = "!!!"
38 | XCTAssert(str == "Huge Gold!!!")
39 |
40 | str[..<4] = "Good"
41 | XCTAssert(str == "Good Gold!!!")
42 |
43 | str[...3] = "Goodbye"
44 | XCTAssert(str == "Goodbye Gold!!!")
45 | }
46 |
47 | func testZfill() {
48 | let str = "abc"
49 |
50 | let str2 = str.zfill(2)
51 | XCTAssert(str2 == "abc")
52 |
53 | let str3 = str.zfill(3)
54 | XCTAssert(str3 == "abc")
55 |
56 | let str4 = str.zfill(10)
57 | XCTAssert(str4 == "0000000abc")
58 |
59 | let str5 = str.zfill(10, with: "x")
60 | XCTAssert(str5 == "xxxxxxxabc")
61 | }
62 |
63 | func testOccurence() {
64 | let str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
65 |
66 | XCTAssert(str.occurence(of: " ") == 68)
67 |
68 | let str2 = String(repeating: "a", count: 1000)
69 | measure {
70 | str2.occurence(of: "a")
71 | }
72 | }
73 |
74 | func testLtrim() {
75 |
76 | XCTAssert(" abcd ".trimLeft() == "abcd ")
77 | XCTAssert(" abcd".trimLeft() == "abcd")
78 | XCTAssert("".trimLeft() == "")
79 | XCTAssert("abcd ".trimLeft() == "abcd ")
80 | XCTAssert("Hello, World!".trimLeft() == "Hello, World!")
81 | let str = " a"
82 | measure {
83 | str.trimLeft()
84 | }
85 | }
86 |
87 | func testRtrim() {
88 |
89 | XCTAssert(" abcd ".trimRight() == " abcd")
90 | XCTAssert(" abcd".trimRight() == " abcd")
91 | XCTAssert("".trimRight() == "")
92 | XCTAssert("abcd ".trimRight() == "abcd")
93 | XCTAssert("Hello, World!".trimRight() == "Hello, World!")
94 | let str = "a "
95 | measure {
96 | str.trimRight()
97 | }
98 | }
99 |
100 | func testTrim() {
101 | XCTAssert(" abcd ".trim() == "abcd")
102 | XCTAssert(" abcd".trim() == "abcd")
103 | XCTAssert("".trim() == "")
104 | XCTAssert("abcd ".trim() == "abcd")
105 | XCTAssert("Hello, World!".trim() == "Hello, World!")
106 | let str = " a "
107 | measure {
108 | str.trim()
109 | }
110 | }
111 |
112 | func testSliced() {
113 | XCTAssertEqual("abcdef".sliced(from: "a", to: "d"), "abcd")
114 | XCTAssertEqual("abcdef".sliced(from: "a", to: "a"), "a")
115 | XCTAssertEqual("abcdef".sliced(from: "a", to: "d", inversed: true), "dcba")
116 | XCTAssertEqual("abcdef".sliced(from: "a", to: "a", inversed: true), "a")
117 | XCTAssertEqual("abcdef".sliced(from: "a", to: "g"), "")
118 | XCTAssertEqual("abcdef".sliced(from: "g", to: "g"), "")
119 | }
120 |
121 | func testSlice() {
122 | var string = "abcdef"
123 | string.slice(from: "a", to: "d")
124 | XCTAssertEqual(string, "abcd")
125 | string = "abcdef"
126 | string.slice(from: "a", to: "a")
127 | XCTAssertEqual(string, "a")
128 | string = "abcdef"
129 | string.slice(from: "a", to: "d", inversed: true)
130 | XCTAssertEqual(string, "dcba")
131 | string = "abcdef"
132 | string.slice(from: "a", to: "a", inversed: true)
133 | XCTAssertEqual(string, "a")
134 | string = "abcdef"
135 | string.slice(from: "a", to: "g")
136 | XCTAssertEqual(string, "")
137 | string = "abcdef"
138 | string.slice(from: "g", to: "g")
139 | XCTAssertEqual(string, "")
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import AGStringTests
3 |
4 | XCTMain([
5 | testCase(AGStringTests.allTests),
6 | ])
7 |
--------------------------------------------------------------------------------
/deploy_rsa.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SwiftAlgorithmClub/AGString/057f573898d60c95582f92418d4572d804a46a7e/deploy_rsa.enc
--------------------------------------------------------------------------------
/fastlane/.env:
--------------------------------------------------------------------------------
1 | FASTLANE_SKIP_UPDATE_CHECK=1
--------------------------------------------------------------------------------
/fastlane/Fastfile:
--------------------------------------------------------------------------------
1 | fastlane_version "2.120.0"
2 |
3 | default_platform :ios
4 |
5 | platform :ios do
6 |
7 | desc "Release a new version of AGString"
8 | lane :release do |options|
9 | # Ensure Git status is clean
10 | ensure_git_status_clean
11 | # Ensure Git branch is master
12 | ensure_git_branch(branch: 'master')
13 | # Perform Dependency-Manager compatibility tests
14 | compatibilityTests
15 | # Perform Tests
16 | tests
17 | # Retrieve Version from options
18 | version = options[:version]
19 | # Increment Version
20 | increment(version: version)
21 | # Add Git Tag
22 | add_git_tag(tag: version)
23 | # Push Git Tag
24 | push_git_tags()
25 | # Push Git commit
26 | push_to_git_remote()
27 | # Pod push / Pod trunk
28 | pod_push()
29 | end
30 |
31 | desc "Increment Version"
32 | lane :increment do |options|
33 | # Retrieve Version from options
34 | version = options[:version]
35 | # Set Podspec version
36 | version_bump_podspec(
37 | path: "AGString.podspec",
38 | version_number: version
39 | )
40 | # Set Framework plist version
41 | set_info_plist_value(
42 | path: "Configs/AGString.plist",
43 | key: "CFBundleShortVersionString",
44 | value: version
45 | )
46 | # Set Framework Tests plist version
47 | set_info_plist_value(
48 | path: "Configs/AGStringTests.plist",
49 | key: "CFBundleShortVersionString",
50 | value: version
51 | )
52 | # Set Example plist version
53 | set_info_plist_value(
54 | path: "Example/Resources/Info.plist",
55 | key: "CFBundleShortVersionString",
56 | value: version
57 | )
58 | # Commit modified files
59 | git_commit(
60 | path: [
61 | "AGString.podspec",
62 | "Configs/AGString.plist",
63 | "Configs/AGStringTests.plist",
64 | "Example/Resources/Info.plist"
65 | ],
66 | message: "AGString Version #{version} 🚀"
67 | )
68 | end
69 |
70 | desc "Runs tests"
71 | lane :tests do
72 | # Perform iOS Tests
73 | scan(
74 | project: "AGString.xcodeproj",
75 | scheme: "AGString-iOS",
76 | clean: true
77 | )
78 | # Perform tvOS Tests
79 | scan(
80 | project: "AGString.xcodeproj",
81 | scheme: "AGString-tvOS",
82 | clean: true
83 | )
84 | # Perform macOS Tests
85 | spm(command: "test")
86 | # Delete SPM build artifacts
87 | spm(command: "clean")
88 | end
89 |
90 | desc "Run Dependency-Manager compatibility tests"
91 | lane :compatibilityTests do
92 | # Carthage build to ensure Carthage compatibility
93 | carthage(
94 | command: "build",
95 | no_skip_current: true,
96 | cache_builds: true
97 | )
98 | # Pod lib lint to ensure CocoaPods compatibility
99 | pod_lib_lint(allow_warnings: true)
100 | # SPM Build to ensure Swift Package Manager compatibility
101 | spm(command: "build")
102 | # Delete SPM build artifacts
103 | spm(command: "clean")
104 | end
105 |
106 | end
107 |
--------------------------------------------------------------------------------
/sonar-project.properties:
--------------------------------------------------------------------------------
1 | sonar.projectKey=SwiftAlgorithmClub_AGString
2 | sonar.organization=swiftalgorithmclub
3 |
4 | # this is the name and version displayed in the SonarCloud UI.
5 | sonar.projectName=AGString
6 | sonar.projectVersion=1.0
7 |
8 | # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
9 | # This property is optional if sonar.modules is set.
10 | sonar.sources=.
11 |
12 | sonar.exclusions=**/Test*.swift
13 |
14 | # Encoding of the source code. Default is default system encoding
15 | #sonar.sourceEncoding=UTF-8
16 |
17 | # The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper
18 | # and setting the property "sonar.cfamily.build-wrapper-output", but it was not specified.
19 | # If you don't want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:
20 | sonar.c.file.suffixes=-
21 | sonar.cpp.file.suffixes=-
22 | sonar.objc.file.suffixes=-
--------------------------------------------------------------------------------