diff --git a/.gitignore b/.gitignore index db94262..b7ebf07 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ xcuserdata # Cocoapods */Pods/* + +# SPM +.build diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..3cb7fc7 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.7 + +import PackageDescription + +let package = Package( + name: "IonIcons", + products: [ + .library(name: "IonIcons", targets: ["IonIcons"]), + .library(name: "IonIconsSwift", targets: ["IonIconsSwift"]), + ], + targets: [ + .target( + name: "IonIcons", + path: "ionicons/", + sources: [ + "FontInspector.h", + "FontInspector.m", + "ionicons-codes.h", + "IonIcons-iOS.h", + "IonIcons-iOS.m", + ], + resources: [ + .process("ionicons.ttf"), + ], + publicHeadersPath: "." + ), + .target( + name: "IonIconsSwift", + dependencies: [ + "IonIcons" + ] + ), + ] +) diff --git a/Sources/IonIconsSwift/SwiftExtension.swift b/Sources/IonIconsSwift/SwiftExtension.swift new file mode 100644 index 0000000..133feed --- /dev/null +++ b/Sources/IonIconsSwift/SwiftExtension.swift @@ -0,0 +1,756 @@ +import IonIcons +import UIKit + +public enum IconName: String { + case alert = "\u{f101}" + case alertCircled = "\u{f100}" + case androidAdd = "\u{f2c7}" + case androidAddCircle = "\u{f359}" + case androidAlarmClock = "\u{f35a}" + case androidAlert = "\u{f35b}" + case androidApps = "\u{f35c}" + case androidArchive = "\u{f2c9}" + case androidArrowBack = "\u{f2ca}" + case androidArrowDown = "\u{f35d}" + case androidArrowDropdown = "\u{f35f}" + case androidArrowDropdownCircle = "\u{f35e}" + case androidArrowDropleft = "\u{f361}" + case androidArrowDropleftCircle = "\u{f360}" + case androidArrowDropright = "\u{f363}" + case androidArrowDroprightCircle = "\u{f362}" + case androidArrowDropup = "\u{f365}" + case androidArrowDropupCircle = "\u{f364}" + case androidArrowForward = "\u{f30f}" + case androidArrowUp = "\u{f366}" + case androidAttach = "\u{f367}" + case androidBar = "\u{f368}" + case androidBicycle = "\u{f369}" + case androidBoat = "\u{f36a}" + case androidBookmark = "\u{f36b}" + case androidBulb = "\u{f36c}" + case androidBus = "\u{f36d}" + case androidCalendar = "\u{f2d1}" + case androidCall = "\u{f2d2}" + case androidCamera = "\u{f2d3}" + case androidCancel = "\u{f36e}" + case androidCar = "\u{f36f}" + case androidCart = "\u{f370}" + case androidChat = "\u{f2d4}" + case androidCheckbox = "\u{f374}" + case androidCheckboxBlank = "\u{f371}" + case androidCheckboxOutline = "\u{f373}" + case androidCheckboxOutlineBlank = "\u{f372}" + case androidCheckmarkCircle = "\u{f375}" + case androidClipboard = "\u{f376}" + case androidClose = "\u{f2d7}" + case androidCloud = "\u{f37a}" + case androidCloudCircle = "\u{f377}" + case androidCloudDone = "\u{f378}" + case androidCloudOutline = "\u{f379}" + case androidColorPalette = "\u{f37b}" + case androidCompass = "\u{f37c}" + case androidContact = "\u{f2d8}" + case androidContacts = "\u{f2d9}" + case androidContract = "\u{f37d}" + case androidCreate = "\u{f37e}" + case androidDelete = "\u{f37f}" + case androidDesktop = "\u{f380}" + case androidDocument = "\u{f381}" + case androidDone = "\u{f383}" + case androidDoneAll = "\u{f382}" + case androidDownload = "\u{f2dd}" + case androidDrafts = "\u{f384}" + case androidExit = "\u{f385}" + case androidExpand = "\u{f386}" + case androidFavorite = "\u{f388}" + case androidFavoriteOutline = "\u{f387}" + case androidFilm = "\u{f389}" + case androidFolder = "\u{f2e0}" + case androidFolderOpen = "\u{f38a}" + case androidFunnel = "\u{f38b}" + case androidGlobe = "\u{f38c}" + case androidHand = "\u{f2e3}" + case androidHangout = "\u{f38d}" + case androidHappy = "\u{f38e}" + case androidHome = "\u{f38f}" + case androidImage = "\u{f2e4}" + case androidLaptop = "\u{f390}" + case androidList = "\u{f391}" + case androidLocate = "\u{f2e9}" + case androidLock = "\u{f392}" + case androidMail = "\u{f2eb}" + case androidMap = "\u{f393}" + case androidMenu = "\u{f394}" + case androidMicrophone = "\u{f2ec}" + case androidMicrophoneOff = "\u{f395}" + case androidMoreHorizontal = "\u{f396}" + case androidMoreVertical = "\u{f397}" + case androidNavigate = "\u{f398}" + case androidNotifications = "\u{f39b}" + case androidNotificationsNone = "\u{f399}" + case androidNotificationsOff = "\u{f39a}" + case androidOpen = "\u{f39c}" + case androidOptions = "\u{f39d}" + case androidPeople = "\u{f39e}" + case androidPerson = "\u{f3a0}" + case androidPersonAdd = "\u{f39f}" + case androidPhoneLandscape = "\u{f3a1}" + case androidPhonePortrait = "\u{f3a2}" + case androidPin = "\u{f3a3}" + case androidPlane = "\u{f3a4}" + case androidPlaystore = "\u{f2f0}" + case androidPrint = "\u{f3a5}" + case androidRadioButtonOff = "\u{f3a6}" + case androidRadioButtonOn = "\u{f3a7}" + case androidRefresh = "\u{f3a8}" + case androidRemove = "\u{f2f4}" + case androidRemoveCircle = "\u{f3a9}" + case androidRestaurant = "\u{f3aa}" + case androidSad = "\u{f3ab}" + case androidSearch = "\u{f2f5}" + case androidSend = "\u{f2f6}" + case androidSettings = "\u{f2f7}" + case androidShare = "\u{f2f8}" + case androidShareAlt = "\u{f3ac}" + case androidStar = "\u{f2fc}" + case androidStarHalf = "\u{f3ad}" + case androidStarOutline = "\u{f3ae}" + case androidStopwatch = "\u{f2fd}" + case androidSubway = "\u{f3af}" + case androidSunny = "\u{f3b0}" + case androidSync = "\u{f3b1}" + case androidTextsms = "\u{f3b2}" + case androidTime = "\u{f3b3}" + case androidTrain = "\u{f3b4}" + case androidUnlock = "\u{f3b5}" + case androidUpload = "\u{f3b6}" + case androidVolumeDown = "\u{f3b7}" + case androidVolumeMute = "\u{f3b8}" + case androidVolumeOff = "\u{f3b9}" + case androidVolumeUp = "\u{f3ba}" + case androidWalk = "\u{f3bb}" + case androidWarning = "\u{f3bc}" + case androidWatch = "\u{f3bd}" + case androidWifi = "\u{f305}" + case aperture = "\u{f313}" + case archive = "\u{f102}" + case arrowDownA = "\u{f103}" + case arrowDownB = "\u{f104}" + case arrowDownC = "\u{f105}" + case arrowExpand = "\u{f25e}" + case arrowGraphDownLeft = "\u{f25f}" + case arrowGraphDownRight = "\u{f260}" + case arrowGraphUpLeft = "\u{f261}" + case arrowGraphUpRight = "\u{f262}" + case arrowLeftA = "\u{f106}" + case arrowLeftB = "\u{f107}" + case arrowLeftC = "\u{f108}" + case arrowMove = "\u{f263}" + case arrowResize = "\u{f264}" + case arrowReturnLeft = "\u{f265}" + case arrowReturnRight = "\u{f266}" + case arrowRightA = "\u{f109}" + case arrowRightB = "\u{f10a}" + case arrowRightC = "\u{f10b}" + case arrowShrink = "\u{f267}" + case arrowSwap = "\u{f268}" + case arrowUpA = "\u{f10c}" + case arrowUpB = "\u{f10d}" + case arrowUpC = "\u{f10e}" + case asterisk = "\u{f314}" + case at = "\u{f10f}" + case backspace = "\u{f3bf}" + case backspaceOutline = "\u{f3be}" + case bag = "\u{f110}" + case batteryCharging = "\u{f111}" + case batteryEmpty = "\u{f112}" + case batteryFull = "\u{f113}" + case batteryHalf = "\u{f114}" + case batteryLow = "\u{f115}" + case beaker = "\u{f269}" + case beer = "\u{f26a}" + case bluetooth = "\u{f116}" + case bonfire = "\u{f315}" + case bookmark = "\u{f26b}" + case bowtie = "\u{f3c0}" + case briefcase = "\u{f26c}" + case bug = "\u{f2be}" + case calculator = "\u{f26d}" + case calendar = "\u{f117}" + case camera = "\u{f118}" + case card = "\u{f119}" + case cash = "\u{f316}" + case chatbox = "\u{f11b}" + case chatboxWorking = "\u{f11a}" + case chatboxes = "\u{f11c}" + case chatbubble = "\u{f11e}" + case chatbubbleWorking = "\u{f11d}" + case chatbubbles = "\u{f11f}" + case checkmark = "\u{f122}" + case checkmarkCircled = "\u{f120}" + case checkmarkRound = "\u{f121}" + case chevronDown = "\u{f123}" + case chevronLeft = "\u{f124}" + case chevronRight = "\u{f125}" + case chevronUp = "\u{f126}" + case clipboard = "\u{f127}" + case clock = "\u{f26e}" + case close = "\u{f12a}" + case closeCircled = "\u{f128}" + case closeRound = "\u{f129}" + case closedCaptioning = "\u{f317}" + case cloud = "\u{f12b}" + case code = "\u{f271}" + case codeDownload = "\u{f26f}" + case codeWorking = "\u{f270}" + case coffee = "\u{f272}" + case compass = "\u{f273}" + case compose = "\u{f12c}" + case connectionBars = "\u{f274}" + case contrast = "\u{f275}" + case crop = "\u{f3c1}" + case cube = "\u{f318}" + case disc = "\u{f12d}" + case document = "\u{f12f}" + case documentText = "\u{f12e}" + case drag = "\u{f130}" + case earth = "\u{f276}" + case easel = "\u{f3c2}" + case edit = "\u{f2bf}" + case egg = "\u{f277}" + case eject = "\u{f131}" + case email = "\u{f132}" + case emailUnread = "\u{f3c3}" + case erlenmeyerFlask = "\u{f3c5}" + case erlenmeyerFlaskBubbles = "\u{f3c4}" + case eye = "\u{f133}" + case eyeDisabled = "\u{f306}" + case female = "\u{f278}" + case filing = "\u{f134}" + case filmMarker = "\u{f135}" + case fireball = "\u{f319}" + case flag = "\u{f279}" + case flame = "\u{f31a}" + case flash = "\u{f137}" + case flashOff = "\u{f136}" + case folder = "\u{f139}" + case fork = "\u{f27a}" + case forkRepo = "\u{f2c0}" + case forward = "\u{f13a}" + case funnel = "\u{f31b}" + case gearA = "\u{f13d}" + case gearB = "\u{f13e}" + case grid = "\u{f13f}" + case hammer = "\u{f27b}" + case happy = "\u{f31c}" + case happyOutline = "\u{f3c6}" + case headphone = "\u{f140}" + case heart = "\u{f141}" + case heartBroken = "\u{f31d}" + case help = "\u{f143}" + case helpBuoy = "\u{f27c}" + case helpCircled = "\u{f142}" + case home = "\u{f144}" + case icecream = "\u{f27d}" + case image = "\u{f147}" + case images = "\u{f148}" + case information = "\u{f14a}" + case informationCircled = "\u{f149}" + case ionic = "\u{f14b}" + case iosAlarm = "\u{f3c8}" + case iosAlarmOutline = "\u{f3c7}" + case iosAlbums = "\u{f3ca}" + case iosAlbumsOutline = "\u{f3c9}" + case iosAmericanfootball = "\u{f3cc}" + case iosAmericanfootballOutline = "\u{f3cb}" + case iosAnalytics = "\u{f3ce}" + case iosAnalyticsOutline = "\u{f3cd}" + case iosArrowBack = "\u{f3cf}" + case iosArrowDown = "\u{f3d0}" + case iosArrowForward = "\u{f3d1}" + case iosArrowLeft = "\u{f3d2}" + case iosArrowRight = "\u{f3d3}" + case iosArrowThinDown = "\u{f3d4}" + case iosArrowThinLeft = "\u{f3d5}" + case iosArrowThinRight = "\u{f3d6}" + case iosArrowThinUp = "\u{f3d7}" + case iosArrowUp = "\u{f3d8}" + case iosAt = "\u{f3da}" + case iosAtOutline = "\u{f3d9}" + case iosBarcode = "\u{f3dc}" + case iosBarcodeOutline = "\u{f3db}" + case iosBaseball = "\u{f3de}" + case iosBaseballOutline = "\u{f3dd}" + case iosBasketball = "\u{f3e0}" + case iosBasketballOutline = "\u{f3df}" + case iosBell = "\u{f3e2}" + case iosBellOutline = "\u{f3e1}" + case iosBody = "\u{f3e4}" + case iosBodyOutline = "\u{f3e3}" + case iosBolt = "\u{f3e6}" + case iosBoltOutline = "\u{f3e5}" + case iosBook = "\u{f3e8}" + case iosBookOutline = "\u{f3e7}" + case iosBookmarks = "\u{f3ea}" + case iosBookmarksOutline = "\u{f3e9}" + case iosBox = "\u{f3ec}" + case iosBoxOutline = "\u{f3eb}" + case iosBriefcase = "\u{f3ee}" + case iosBriefcaseOutline = "\u{f3ed}" + case iosBrowsers = "\u{f3f0}" + case iosBrowsersOutline = "\u{f3ef}" + case iosCalculator = "\u{f3f2}" + case iosCalculatorOutline = "\u{f3f1}" + case iosCalendar = "\u{f3f4}" + case iosCalendarOutline = "\u{f3f3}" + case iosCamera = "\u{f3f6}" + case iosCameraOutline = "\u{f3f5}" + case iosCart = "\u{f3f8}" + case iosCartOutline = "\u{f3f7}" + case iosChatboxes = "\u{f3fa}" + case iosChatboxesOutline = "\u{f3f9}" + case iosChatbubble = "\u{f3fc}" + case iosChatbubbleOutline = "\u{f3fb}" + case iosCheckmark = "\u{f3ff}" + case iosCheckmarkEmpty = "\u{f3fd}" + case iosCheckmarkOutline = "\u{f3fe}" + case iosCircleFilled = "\u{f400}" + case iosCircleOutline = "\u{f401}" + case iosClock = "\u{f403}" + case iosClockOutline = "\u{f402}" + case iosClose = "\u{f406}" + case iosCloseEmpty = "\u{f404}" + case iosCloseOutline = "\u{f405}" + case iosCloud = "\u{f40c}" + case iosCloudDownload = "\u{f408}" + case iosCloudDownloadOutline = "\u{f407}" + case iosCloudOutline = "\u{f409}" + case iosCloudUpload = "\u{f40b}" + case iosCloudUploadOutline = "\u{f40a}" + case iosCloudy = "\u{f410}" + case iosCloudyNight = "\u{f40e}" + case iosCloudyNightOutline = "\u{f40d}" + case iosCloudyOutline = "\u{f40f}" + case iosCog = "\u{f412}" + case iosCogOutline = "\u{f411}" + case iosColorFilter = "\u{f414}" + case iosColorFilterOutline = "\u{f413}" + case iosColorWand = "\u{f416}" + case iosColorWandOutline = "\u{f415}" + case iosCompose = "\u{f418}" + case iosComposeOutline = "\u{f417}" + case iosContact = "\u{f41a}" + case iosContactOutline = "\u{f419}" + case iosCopy = "\u{f41c}" + case iosCopyOutline = "\u{f41b}" + case iosCrop = "\u{f41e}" + case iosCropStrong = "\u{f41d}" + case iosDownload = "\u{f420}" + case iosDownloadOutline = "\u{f41f}" + case iosDrag = "\u{f421}" + case iosEmail = "\u{f423}" + case iosEmailOutline = "\u{f422}" + case iosEye = "\u{f425}" + case iosEyeOutline = "\u{f424}" + case iosFastforward = "\u{f427}" + case iosFastforwardOutline = "\u{f426}" + case iosFiling = "\u{f429}" + case iosFilingOutline = "\u{f428}" + case iosFilm = "\u{f42b}" + case iosFilmOutline = "\u{f42a}" + case iosFlag = "\u{f42d}" + case iosFlagOutline = "\u{f42c}" + case iosFlame = "\u{f42f}" + case iosFlameOutline = "\u{f42e}" + case iosFlask = "\u{f431}" + case iosFlaskOutline = "\u{f430}" + case iosFlower = "\u{f433}" + case iosFlowerOutline = "\u{f432}" + case iosFolder = "\u{f435}" + case iosFolderOutline = "\u{f434}" + case iosFootball = "\u{f437}" + case iosFootballOutline = "\u{f436}" + case iosGameControllerA = "\u{f439}" + case iosGameControllerAOutline = "\u{f438}" + case iosGameControllerB = "\u{f43b}" + case iosGameControllerBOutline = "\u{f43a}" + case iosGear = "\u{f43d}" + case iosGearOutline = "\u{f43c}" + case iosGlasses = "\u{f43f}" + case iosGlassesOutline = "\u{f43e}" + case iosGridView = "\u{f441}" + case iosGridViewOutline = "\u{f440}" + case iosHeart = "\u{f443}" + case iosHeartOutline = "\u{f442}" + case iosHelp = "\u{f446}" + case iosHelpEmpty = "\u{f444}" + case iosHelpOutline = "\u{f445}" + case iosHome = "\u{f448}" + case iosHomeOutline = "\u{f447}" + case iosInfinite = "\u{f44a}" + case iosInfiniteOutline = "\u{f449}" + case iosInformation = "\u{f44d}" + case iosInformationEmpty = "\u{f44b}" + case iosInformationOutline = "\u{f44c}" + case iosIonicOutline = "\u{f44e}" + case iosKeypad = "\u{f450}" + case iosKeypadOutline = "\u{f44f}" + case iosLightbulb = "\u{f452}" + case iosLightbulbOutline = "\u{f451}" + case iosList = "\u{f454}" + case iosListOutline = "\u{f453}" + case iosLocation = "\u{f456}" + case iosLocationOutline = "\u{f455}" + case iosLocked = "\u{f458}" + case iosLockedOutline = "\u{f457}" + case iosLoop = "\u{f45a}" + case iosLoopStrong = "\u{f459}" + case iosMedical = "\u{f45c}" + case iosMedicalOutline = "\u{f45b}" + case iosMedkit = "\u{f45e}" + case iosMedkitOutline = "\u{f45d}" + case iosMic = "\u{f461}" + case iosMicOff = "\u{f45f}" + case iosMicOutline = "\u{f460}" + case iosMinus = "\u{f464}" + case iosMinusEmpty = "\u{f462}" + case iosMinusOutline = "\u{f463}" + case iosMonitor = "\u{f466}" + case iosMonitorOutline = "\u{f465}" + case iosMoon = "\u{f468}" + case iosMoonOutline = "\u{f467}" + case iosMore = "\u{f46a}" + case iosMoreOutline = "\u{f469}" + case iosMusicalNote = "\u{f46b}" + case iosMusicalNotes = "\u{f46c}" + case iosNavigate = "\u{f46e}" + case iosNavigateOutline = "\u{f46d}" + case iosNutrition = "\u{f470}" + case iosNutritionOutline = "\u{f46f}" + case iosPaper = "\u{f472}" + case iosPaperOutline = "\u{f471}" + case iosPaperplane = "\u{f474}" + case iosPaperplaneOutline = "\u{f473}" + case iosPartlysunny = "\u{f476}" + case iosPartlysunnyOutline = "\u{f475}" + case iosPause = "\u{f478}" + case iosPauseOutline = "\u{f477}" + case iosPaw = "\u{f47a}" + case iosPawOutline = "\u{f479}" + case iosPeople = "\u{f47c}" + case iosPeopleOutline = "\u{f47b}" + case iosPerson = "\u{f47e}" + case iosPersonOutline = "\u{f47d}" + case iosPersonadd = "\u{f480}" + case iosPersonaddOutline = "\u{f47f}" + case iosPhotos = "\u{f482}" + case iosPhotosOutline = "\u{f481}" + case iosPie = "\u{f484}" + case iosPieOutline = "\u{f483}" + case iosPint = "\u{f486}" + case iosPintOutline = "\u{f485}" + case iosPlay = "\u{f488}" + case iosPlayOutline = "\u{f487}" + case iosPlus = "\u{f48b}" + case iosPlusEmpty = "\u{f489}" + case iosPlusOutline = "\u{f48a}" + case iosPricetag = "\u{f48d}" + case iosPricetagOutline = "\u{f48c}" + case iosPricetags = "\u{f48f}" + case iosPricetagsOutline = "\u{f48e}" + case iosPrinter = "\u{f491}" + case iosPrinterOutline = "\u{f490}" + case iosPulse = "\u{f493}" + case iosPulseStrong = "\u{f492}" + case iosRainy = "\u{f495}" + case iosRainyOutline = "\u{f494}" + case iosRecording = "\u{f497}" + case iosRecordingOutline = "\u{f496}" + case iosRedo = "\u{f499}" + case iosRedoOutline = "\u{f498}" + case iosRefresh = "\u{f49c}" + case iosRefreshEmpty = "\u{f49a}" + case iosRefreshOutline = "\u{f49b}" + case iosReload = "\u{f49d}" + case iosReverseCamera = "\u{f49f}" + case iosReverseCameraOutline = "\u{f49e}" + case iosRewind = "\u{f4a1}" + case iosRewindOutline = "\u{f4a0}" + case iosRose = "\u{f4a3}" + case iosRoseOutline = "\u{f4a2}" + case iosSearch = "\u{f4a5}" + case iosSearchStrong = "\u{f4a4}" + case iosSettings = "\u{f4a7}" + case iosSettingsStrong = "\u{f4a6}" + case iosShuffle = "\u{f4a9}" + case iosShuffleStrong = "\u{f4a8}" + case iosSkipbackward = "\u{f4ab}" + case iosSkipbackwardOutline = "\u{f4aa}" + case iosSkipforward = "\u{f4ad}" + case iosSkipforwardOutline = "\u{f4ac}" + case iosSnowy = "\u{f4ae}" + case iosSpeedometer = "\u{f4b0}" + case iosSpeedometerOutline = "\u{f4af}" + case iosStar = "\u{f4b3}" + case iosStarHalf = "\u{f4b1}" + case iosStarOutline = "\u{f4b2}" + case iosStopwatch = "\u{f4b5}" + case iosStopwatchOutline = "\u{f4b4}" + case iosSunny = "\u{f4b7}" + case iosSunnyOutline = "\u{f4b6}" + case iosTelephone = "\u{f4b9}" + case iosTelephoneOutline = "\u{f4b8}" + case iosTennisball = "\u{f4bb}" + case iosTennisballOutline = "\u{f4ba}" + case iosThunderstorm = "\u{f4bd}" + case iosThunderstormOutline = "\u{f4bc}" + case iosTime = "\u{f4bf}" + case iosTimeOutline = "\u{f4be}" + case iosTimer = "\u{f4c1}" + case iosTimerOutline = "\u{f4c0}" + case iosToggle = "\u{f4c3}" + case iosToggleOutline = "\u{f4c2}" + case iosTrash = "\u{f4c5}" + case iosTrashOutline = "\u{f4c4}" + case iosUndo = "\u{f4c7}" + case iosUndoOutline = "\u{f4c6}" + case iosUnlocked = "\u{f4c9}" + case iosUnlockedOutline = "\u{f4c8}" + case iosUpload = "\u{f4cb}" + case iosUploadOutline = "\u{f4ca}" + case iosVideocam = "\u{f4cd}" + case iosVideocamOutline = "\u{f4cc}" + case iosVolumeHigh = "\u{f4ce}" + case iosVolumeLow = "\u{f4cf}" + case iosWineglass = "\u{f4d1}" + case iosWineglassOutline = "\u{f4d0}" + case iosWorld = "\u{f4d3}" + case iosWorldOutline = "\u{f4d2}" + case ipad = "\u{f1f9}" + case iphone = "\u{f1fa}" + case ipod = "\u{f1fb}" + case jet = "\u{f295}" + case key = "\u{f296}" + case knife = "\u{f297}" + case laptop = "\u{f1fc}" + case leaf = "\u{f1fd}" + case levels = "\u{f298}" + case lightbulb = "\u{f299}" + case link = "\u{f1fe}" + case loadA = "\u{f29a}" + case loadB = "\u{f29b}" + case loadC = "\u{f29c}" + case loadD = "\u{f29d}" + case location = "\u{f1ff}" + case lockCombination = "\u{f4d4}" + case locked = "\u{f200}" + case logIn = "\u{f29e}" + case logOut = "\u{f29f}" + case loop = "\u{f201}" + case magnet = "\u{f2a0}" + case male = "\u{f2a1}" + case man = "\u{f202}" + case map = "\u{f203}" + case medkit = "\u{f2a2}" + case merge = "\u{f33f}" + case micA = "\u{f204}" + case micB = "\u{f205}" + case micC = "\u{f206}" + case minus = "\u{f209}" + case minusCircled = "\u{f207}" + case minusRound = "\u{f208}" + case modelS = "\u{f2c1}" + case monitor = "\u{f20a}" + case more = "\u{f20b}" + case mouse = "\u{f340}" + case musicNote = "\u{f20c}" + case navicon = "\u{f20e}" + case naviconRound = "\u{f20d}" + case navigate = "\u{f2a3}" + case network = "\u{f341}" + case noSmoking = "\u{f2c2}" + case nuclear = "\u{f2a4}" + case outlet = "\u{f342}" + case paintbrush = "\u{f4d5}" + case paintbucket = "\u{f4d6}" + case paperAirplane = "\u{f2c3}" + case paperclip = "\u{f20f}" + case pause = "\u{f210}" + case person = "\u{f213}" + case personAdd = "\u{f211}" + case personStalker = "\u{f212}" + case pieGraph = "\u{f2a5}" + case pin = "\u{f2a6}" + case pinpoint = "\u{f2a7}" + case pizza = "\u{f2a8}" + case plane = "\u{f214}" + case planet = "\u{f343}" + case play = "\u{f215}" + case playstation = "\u{f30a}" + case plus = "\u{f218}" + case plusCircled = "\u{f216}" + case plusRound = "\u{f217}" + case podium = "\u{f344}" + case pound = "\u{f219}" + case power = "\u{f2a9}" + case pricetag = "\u{f2aa}" + case pricetags = "\u{f2ab}" + case printer = "\u{f21a}" + case pullRequest = "\u{f345}" + case qrScanner = "\u{f346}" + case quote = "\u{f347}" + case radioWaves = "\u{f2ac}" + case record = "\u{f21b}" + case refresh = "\u{f21c}" + case reply = "\u{f21e}" + case replyAll = "\u{f21d}" + case ribbonA = "\u{f348}" + case ribbonB = "\u{f349}" + case sad = "\u{f34a}" + case sadOutline = "\u{f4d7}" + case scissors = "\u{f34b}" + case search = "\u{f21f}" + case settings = "\u{f2ad}" + case share = "\u{f220}" + case shuffle = "\u{f221}" + case skipBackward = "\u{f222}" + case skipForward = "\u{f223}" + case socialAndroid = "\u{f225}" + case socialAndroidOutline = "\u{f224}" + case socialAngular = "\u{f4d9}" + case socialAngularOutline = "\u{f4d8}" + case socialApple = "\u{f227}" + case socialAppleOutline = "\u{f226}" + case socialBitcoin = "\u{f2af}" + case socialBitcoinOutline = "\u{f2ae}" + case socialBuffer = "\u{f229}" + case socialBufferOutline = "\u{f228}" + case socialChrome = "\u{f4db}" + case socialChromeOutline = "\u{f4da}" + case socialCodepen = "\u{f4dd}" + case socialCodepenOutline = "\u{f4dc}" + case socialCss3 = "\u{f4df}" + case socialCss3Outline = "\u{f4de}" + case socialDesignernews = "\u{f22b}" + case socialDesignernewsOutline = "\u{f22a}" + case socialDribbble = "\u{f22d}" + case socialDribbbleOutline = "\u{f22c}" + case socialDropbox = "\u{f22f}" + case socialDropboxOutline = "\u{f22e}" + case socialEuro = "\u{f4e1}" + case socialEuroOutline = "\u{f4e0}" + case socialFacebook = "\u{f231}" + case socialFacebookOutline = "\u{f230}" + case socialFoursquare = "\u{f34d}" + case socialFoursquareOutline = "\u{f34c}" + case socialFreebsdDevil = "\u{f2c4}" + case socialGithub = "\u{f233}" + case socialGithubOutline = "\u{f232}" + case socialGoogle = "\u{f34f}" + case socialGoogleOutline = "\u{f34e}" + case socialGoogleplus = "\u{f235}" + case socialGoogleplusOutline = "\u{f234}" + case socialHackernews = "\u{f237}" + case socialHackernewsOutline = "\u{f236}" + case socialHtml5 = "\u{f4e3}" + case socialHtml5Outline = "\u{f4e2}" + case socialInstagram = "\u{f351}" + case socialInstagramOutline = "\u{f350}" + case socialJavascript = "\u{f4e5}" + case socialJavascriptOutline = "\u{f4e4}" + case socialLinkedin = "\u{f239}" + case socialLinkedinOutline = "\u{f238}" + case socialMarkdown = "\u{f4e6}" + case socialNodejs = "\u{f4e7}" + case socialOctocat = "\u{f4e8}" + case socialPinterest = "\u{f2b1}" + case socialPinterestOutline = "\u{f2b0}" + case socialPython = "\u{f4e9}" + case socialReddit = "\u{f23b}" + case socialRedditOutline = "\u{f23a}" + case socialRss = "\u{f23d}" + case socialRssOutline = "\u{f23c}" + case socialSass = "\u{f4ea}" + case socialSkype = "\u{f23f}" + case socialSkypeOutline = "\u{f23e}" + case socialSnapchat = "\u{f4ec}" + case socialSnapchatOutline = "\u{f4eb}" + case socialTumblr = "\u{f241}" + case socialTumblrOutline = "\u{f240}" + case socialTux = "\u{f2c5}" + case socialTwitch = "\u{f4ee}" + case socialTwitchOutline = "\u{f4ed}" + case socialTwitter = "\u{f243}" + case socialTwitterOutline = "\u{f242}" + case socialUsd = "\u{f353}" + case socialUsdOutline = "\u{f352}" + case socialVimeo = "\u{f245}" + case socialVimeoOutline = "\u{f244}" + case socialWhatsapp = "\u{f4f0}" + case socialWhatsappOutline = "\u{f4ef}" + case socialWindows = "\u{f247}" + case socialWindowsOutline = "\u{f246}" + case socialWordpress = "\u{f249}" + case socialWordpressOutline = "\u{f248}" + case socialYahoo = "\u{f24b}" + case socialYahooOutline = "\u{f24a}" + case socialYen = "\u{f4f2}" + case socialYenOutline = "\u{f4f1}" + case socialYoutube = "\u{f24d}" + case socialYoutubeOutline = "\u{f24c}" + case soupCan = "\u{f4f4}" + case soupCanOutline = "\u{f4f3}" + case speakerphone = "\u{f2b2}" + case speedometer = "\u{f2b3}" + case spoon = "\u{f2b4}" + case star = "\u{f24e}" + case statsBars = "\u{f2b5}" + case steam = "\u{f30b}" + case stop = "\u{f24f}" + case thermometer = "\u{f2b6}" + case thumbsdown = "\u{f250}" + case thumbsup = "\u{f251}" + case toggle = "\u{f355}" + case toggleFilled = "\u{f354}" + case transgender = "\u{f4f5}" + case trashA = "\u{f252}" + case trashB = "\u{f253}" + case trophy = "\u{f356}" + case tshirt = "\u{f4f7}" + case tshirtOutline = "\u{f4f6}" + case umbrella = "\u{f2b7}" + case university = "\u{f357}" + case unlocked = "\u{f254}" + case upload = "\u{f255}" + case usb = "\u{f2b8}" + case videocamera = "\u{f256}" + case volumeHigh = "\u{f257}" + case volumeLow = "\u{f258}" + case volumeMedium = "\u{f259}" + case volumeMute = "\u{f25a}" + case wand = "\u{f358}" + case waterdrop = "\u{f25b}" + case wifi = "\u{f25c}" + case wineglass = "\u{f2b9}" + case woman = "\u{f25d}" + case wrench = "\u{f2ba}" + case xbox = "\u{f30c}" +} + +public extension IonIcons { + static func label(withIcon icon: IconName, size: CGFloat, color: UIColor) -> UILabel { + label(withIcon: icon.rawValue, size: size, color: color) + } + + static func label(_ label: UILabel, setIcon icon: IconName, size: CGFloat, color: UIColor, sizeToFit shouldSizeToFit: Bool) { + self.label(label, setIcon: icon.rawValue, size: size, color: color, sizeToFit: shouldSizeToFit) + } + + static func image(withIcon icon: IconName, size: CGFloat, color: UIColor) -> UIImage { + image(withIcon: icon.rawValue, size: size, color: color) + } + + static func image(withIcon icon: IconName, iconColor: UIColor, iconSize: CGFloat, imageSize: CGSize) -> UIImage { + image(withIcon: icon.rawValue, iconColor: iconColor, iconSize: iconSize, imageSize: imageSize) + } +} diff --git a/ionicons/IonIcons-iOS.m b/ionicons/IonIcons-iOS.m index 6b77404..63c79eb 100644 --- a/ionicons/IonIcons-iOS.m +++ b/ionicons/IonIcons-iOS.m @@ -34,8 +34,7 @@ + (UIFont*)fontWithSize:(CGFloat)size; + (void)registerIoniconsFont { - NSBundle *ioniconsBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:self] pathForResource:@"ionicons" ofType:@"bundle"]]; - NSURL *url = [ioniconsBundle URLForResource:fontName withExtension:@"ttf"]; + NSURL *url = [NSURL URLWithString: [[[[NSBundle bundleForClass:self] bundleURL] absoluteString] stringByAppendingString:@"IonIcons_IonIcons.bundle/ionicons.ttf"]]; NSData *fontData = [NSData dataWithContentsOfURL:url]; if (fontData) { CFErrorRef error; diff --git a/ionicons/ionicons.h b/ionicons/ionicons.h deleted file mode 100644 index e8dca55..0000000 --- a/ionicons/ionicons.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// ionicons.h -// ionicons -// -// Created by sweetman on 5/1/17. -// Copyright © 2017 David Sweetman. All rights reserved. -// - -#import - -//! Project version number for ionicons. -FOUNDATION_EXPORT double ioniconsVersionNumber; - -//! Project version string for ionicons. -FOUNDATION_EXPORT const unsigned char ioniconsVersionString[]; - -#import diff --git a/ionicons/ioniconsTests/Info.plist b/ionicons/ioniconsTests/Info.plist deleted file mode 100644 index 6c6c23c..0000000 --- a/ionicons/ioniconsTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/ionicons/ioniconsTests/allIconCodes.h b/ionicons/ioniconsTests/allIconCodes.h deleted file mode 100644 index ee54c57..0000000 --- a/ionicons/ioniconsTests/allIconCodes.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// AUTOGENERATED -// -// This file is auto-generated by generateAllIconCodesArray.sh -// It contains all icon codes for testing purposes. -// - -#import -#import - -static NSArray *allIconCodes() { -return @[ion_alert, ion_alert_circled, ion_android_add, ion_android_add_circle, ion_android_alarm_clock, ion_android_alert, ion_android_apps, ion_android_archive, ion_android_arrow_back, ion_android_arrow_down, ion_android_arrow_dropdown, ion_android_arrow_dropdown_circle, ion_android_arrow_dropleft, ion_android_arrow_dropleft_circle, ion_android_arrow_dropright, ion_android_arrow_dropright_circle, ion_android_arrow_dropup, ion_android_arrow_dropup_circle, ion_android_arrow_forward, ion_android_arrow_up, ion_android_attach, ion_android_bar, ion_android_bicycle, ion_android_boat, ion_android_bookmark, ion_android_bulb, ion_android_bus, ion_android_calendar, ion_android_call, ion_android_camera, ion_android_cancel, ion_android_car, ion_android_cart, ion_android_chat, ion_android_checkbox, ion_android_checkbox_blank, ion_android_checkbox_outline, ion_android_checkbox_outline_blank, ion_android_checkmark_circle, ion_android_clipboard, ion_android_close, ion_android_cloud, ion_android_cloud_circle, ion_android_cloud_done, ion_android_cloud_outline, ion_android_color_palette, ion_android_compass, ion_android_contact, ion_android_contacts, ion_android_contract, ion_android_create, ion_android_delete, ion_android_desktop, ion_android_document, ion_android_done, ion_android_done_all, ion_android_download, ion_android_drafts, ion_android_exit, ion_android_expand, ion_android_favorite, ion_android_favorite_outline, ion_android_film, ion_android_folder, ion_android_folder_open, ion_android_funnel, ion_android_globe, ion_android_hand, ion_android_hangout, ion_android_happy, ion_android_home, ion_android_image, ion_android_laptop, ion_android_list, ion_android_locate, ion_android_lock, ion_android_mail, ion_android_map, ion_android_menu, ion_android_microphone, ion_android_microphone_off, ion_android_more_horizontal, ion_android_more_vertical, ion_android_navigate, ion_android_notifications, ion_android_notifications_none, ion_android_notifications_off, ion_android_open, ion_android_options, ion_android_people, ion_android_person, ion_android_person_add, ion_android_phone_landscape, ion_android_phone_portrait, ion_android_pin, ion_android_plane, ion_android_playstore, ion_android_print, ion_android_radio_button_off, ion_android_radio_button_on, ion_android_refresh, ion_android_remove, ion_android_remove_circle, ion_android_restaurant, ion_android_sad, ion_android_search, ion_android_send, ion_android_settings, ion_android_share, ion_android_share_alt, ion_android_star, ion_android_star_half, ion_android_star_outline, ion_android_stopwatch, ion_android_subway, ion_android_sunny, ion_android_sync, ion_android_textsms, ion_android_time, ion_android_train, ion_android_unlock, ion_android_upload, ion_android_volume_down, ion_android_volume_mute, ion_android_volume_off, ion_android_volume_up, ion_android_walk, ion_android_warning, ion_android_watch, ion_android_wifi, ion_aperture, ion_archive, ion_arrow_down_a, ion_arrow_down_b, ion_arrow_down_c, ion_arrow_expand, ion_arrow_graph_down_left, ion_arrow_graph_down_right, ion_arrow_graph_up_left, ion_arrow_graph_up_right, ion_arrow_left_a, ion_arrow_left_b, ion_arrow_left_c, ion_arrow_move, ion_arrow_resize, ion_arrow_return_left, ion_arrow_return_right, ion_arrow_right_a, ion_arrow_right_b, ion_arrow_right_c, ion_arrow_shrink, ion_arrow_swap, ion_arrow_up_a, ion_arrow_up_b, ion_arrow_up_c, ion_asterisk, ion_at, ion_backspace, ion_backspace_outline, ion_bag, ion_battery_charging, ion_battery_empty, ion_battery_full, ion_battery_half, ion_battery_low, ion_beaker, ion_beer, ion_bluetooth, ion_bonfire, ion_bookmark, ion_bowtie, ion_briefcase, ion_bug, ion_calculator, ion_calendar, ion_camera, ion_card, ion_cash, ion_chatbox, ion_chatbox_working, ion_chatboxes, ion_chatbubble, ion_chatbubble_working, ion_chatbubbles, ion_checkmark, ion_checkmark_circled, ion_checkmark_round, ion_chevron_down, ion_chevron_left, ion_chevron_right, ion_chevron_up, ion_clipboard, ion_clock, ion_close, ion_close_circled, ion_close_round, ion_closed_captioning, ion_cloud, ion_code, ion_code_download, ion_code_working, ion_coffee, ion_compass, ion_compose, ion_connection_bars, ion_contrast, ion_crop, ion_cube, ion_disc, ion_document, ion_document_text, ion_drag, ion_earth, ion_easel, ion_edit, ion_egg, ion_eject, ion_email, ion_email_unread, ion_erlenmeyer_flask, ion_erlenmeyer_flask_bubbles, ion_eye, ion_eye_disabled, ion_female, ion_filing, ion_film_marker, ion_fireball, ion_flag, ion_flame, ion_flash, ion_flash_off, ion_folder, ion_fork, ion_fork_repo, ion_forward, ion_funnel, ion_gear_a, ion_gear_b, ion_grid, ion_hammer, ion_happy, ion_happy_outline, ion_headphone, ion_heart, ion_heart_broken, ion_help, ion_help_buoy, ion_help_circled, ion_home, ion_icecream, ion_image, ion_images, ion_information, ion_information_circled, ion_ionic, ion_ios_alarm, ion_ios_alarm_outline, ion_ios_albums, ion_ios_albums_outline, ion_ios_americanfootball, ion_ios_americanfootball_outline, ion_ios_analytics, ion_ios_analytics_outline, ion_ios_arrow_back, ion_ios_arrow_down, ion_ios_arrow_forward, ion_ios_arrow_left, ion_ios_arrow_right, ion_ios_arrow_thin_down, ion_ios_arrow_thin_left, ion_ios_arrow_thin_right, ion_ios_arrow_thin_up, ion_ios_arrow_up, ion_ios_at, ion_ios_at_outline, ion_ios_barcode, ion_ios_barcode_outline, ion_ios_baseball, ion_ios_baseball_outline, ion_ios_basketball, ion_ios_basketball_outline, ion_ios_bell, ion_ios_bell_outline, ion_ios_body, ion_ios_body_outline, ion_ios_bolt, ion_ios_bolt_outline, ion_ios_book, ion_ios_book_outline, ion_ios_bookmarks, ion_ios_bookmarks_outline, ion_ios_box, ion_ios_box_outline, ion_ios_briefcase, ion_ios_briefcase_outline, ion_ios_browsers, ion_ios_browsers_outline, ion_ios_calculator, ion_ios_calculator_outline, ion_ios_calendar, ion_ios_calendar_outline, ion_ios_camera, ion_ios_camera_outline, ion_ios_cart, ion_ios_cart_outline, ion_ios_chatboxes, ion_ios_chatboxes_outline, ion_ios_chatbubble, ion_ios_chatbubble_outline, ion_ios_checkmark, ion_ios_checkmark_empty, ion_ios_checkmark_outline, ion_ios_circle_filled, ion_ios_circle_outline, ion_ios_clock, ion_ios_clock_outline, ion_ios_close, ion_ios_close_empty, ion_ios_close_outline, ion_ios_cloud, ion_ios_cloud_download, ion_ios_cloud_download_outline, ion_ios_cloud_outline, ion_ios_cloud_upload, ion_ios_cloud_upload_outline, ion_ios_cloudy, ion_ios_cloudy_night, ion_ios_cloudy_night_outline, ion_ios_cloudy_outline, ion_ios_cog, ion_ios_cog_outline, ion_ios_color_filter, ion_ios_color_filter_outline, ion_ios_color_wand, ion_ios_color_wand_outline, ion_ios_compose, ion_ios_compose_outline, ion_ios_contact, ion_ios_contact_outline, ion_ios_copy, ion_ios_copy_outline, ion_ios_crop, ion_ios_crop_strong, ion_ios_download, ion_ios_download_outline, ion_ios_drag, ion_ios_email, ion_ios_email_outline, ion_ios_eye, ion_ios_eye_outline, ion_ios_fastforward, ion_ios_fastforward_outline, ion_ios_filing, ion_ios_filing_outline, ion_ios_film, ion_ios_film_outline, ion_ios_flag, ion_ios_flag_outline, ion_ios_flame, ion_ios_flame_outline, ion_ios_flask, ion_ios_flask_outline, ion_ios_flower, ion_ios_flower_outline, ion_ios_folder, ion_ios_folder_outline, ion_ios_football, ion_ios_football_outline, ion_ios_game_controller_a, ion_ios_game_controller_a_outline, ion_ios_game_controller_b, ion_ios_game_controller_b_outline, ion_ios_gear, ion_ios_gear_outline, ion_ios_glasses, ion_ios_glasses_outline, ion_ios_grid_view, ion_ios_grid_view_outline, ion_ios_heart, ion_ios_heart_outline, ion_ios_help, ion_ios_help_empty, ion_ios_help_outline, ion_ios_home, ion_ios_home_outline, ion_ios_infinite, ion_ios_infinite_outline, ion_ios_information, ion_ios_information_empty, ion_ios_information_outline, ion_ios_ionic_outline, ion_ios_keypad, ion_ios_keypad_outline, ion_ios_lightbulb, ion_ios_lightbulb_outline, ion_ios_list, ion_ios_list_outline, ion_ios_location, ion_ios_location_outline, ion_ios_locked, ion_ios_locked_outline, ion_ios_loop, ion_ios_loop_strong, ion_ios_medical, ion_ios_medical_outline, ion_ios_medkit, ion_ios_medkit_outline, ion_ios_mic, ion_ios_mic_off, ion_ios_mic_outline, ion_ios_minus, ion_ios_minus_empty, ion_ios_minus_outline, ion_ios_monitor, ion_ios_monitor_outline, ion_ios_moon, ion_ios_moon_outline, ion_ios_more, ion_ios_more_outline, ion_ios_musical_note, ion_ios_musical_notes, ion_ios_navigate, ion_ios_navigate_outline, ion_ios_nutrition, ion_ios_nutrition_outline, ion_ios_paper, ion_ios_paper_outline, ion_ios_paperplane, ion_ios_paperplane_outline, ion_ios_partlysunny, ion_ios_partlysunny_outline, ion_ios_pause, ion_ios_pause_outline, ion_ios_paw, ion_ios_paw_outline, ion_ios_people, ion_ios_people_outline, ion_ios_person, ion_ios_person_outline, ion_ios_personadd, ion_ios_personadd_outline, ion_ios_photos, ion_ios_photos_outline, ion_ios_pie, ion_ios_pie_outline, ion_ios_pint, ion_ios_pint_outline, ion_ios_play, ion_ios_play_outline, ion_ios_plus, ion_ios_plus_empty, ion_ios_plus_outline, ion_ios_pricetag, ion_ios_pricetag_outline, ion_ios_pricetags, ion_ios_pricetags_outline, ion_ios_printer, ion_ios_printer_outline, ion_ios_pulse, ion_ios_pulse_strong, ion_ios_rainy, ion_ios_rainy_outline, ion_ios_recording, ion_ios_recording_outline, ion_ios_redo, ion_ios_redo_outline, ion_ios_refresh, ion_ios_refresh_empty, ion_ios_refresh_outline, ion_ios_reload, ion_ios_reverse_camera, ion_ios_reverse_camera_outline, ion_ios_rewind, ion_ios_rewind_outline, ion_ios_rose, ion_ios_rose_outline, ion_ios_search, ion_ios_search_strong, ion_ios_settings, ion_ios_settings_strong, ion_ios_shuffle, ion_ios_shuffle_strong, ion_ios_skipbackward, ion_ios_skipbackward_outline, ion_ios_skipforward, ion_ios_skipforward_outline, ion_ios_snowy, ion_ios_speedometer, ion_ios_speedometer_outline, ion_ios_star, ion_ios_star_half, ion_ios_star_outline, ion_ios_stopwatch, ion_ios_stopwatch_outline, ion_ios_sunny, ion_ios_sunny_outline, ion_ios_telephone, ion_ios_telephone_outline, ion_ios_tennisball, ion_ios_tennisball_outline, ion_ios_thunderstorm, ion_ios_thunderstorm_outline, ion_ios_time, ion_ios_time_outline, ion_ios_timer, ion_ios_timer_outline, ion_ios_toggle, ion_ios_toggle_outline, ion_ios_trash, ion_ios_trash_outline, ion_ios_undo, ion_ios_undo_outline, ion_ios_unlocked, ion_ios_unlocked_outline, ion_ios_upload, ion_ios_upload_outline, ion_ios_videocam, ion_ios_videocam_outline, ion_ios_volume_high, ion_ios_volume_low, ion_ios_wineglass, ion_ios_wineglass_outline, ion_ios_world, ion_ios_world_outline, ion_ipad, ion_iphone, ion_ipod, ion_jet, ion_key, ion_knife, ion_laptop, ion_leaf, ion_levels, ion_lightbulb, ion_link, ion_load_a, ion_load_b, ion_load_c, ion_load_d, ion_location, ion_lock_combination, ion_locked, ion_log_in, ion_log_out, ion_loop, ion_magnet, ion_male, ion_man, ion_map, ion_medkit, ion_merge, ion_mic_a, ion_mic_b, ion_mic_c, ion_minus, ion_minus_circled, ion_minus_round, ion_model_s, ion_monitor, ion_more, ion_mouse, ion_music_note, ion_navicon, ion_navicon_round, ion_navigate, ion_network, ion_no_smoking, ion_nuclear, ion_outlet, ion_paintbrush, ion_paintbucket, ion_paper_airplane, ion_paperclip, ion_pause, ion_person, ion_person_add, ion_person_stalker, ion_pie_graph, ion_pin, ion_pinpoint, ion_pizza, ion_plane, ion_planet, ion_play, ion_playstation, ion_plus, ion_plus_circled, ion_plus_round, ion_podium, ion_pound, ion_power, ion_pricetag, ion_pricetags, ion_printer, ion_pull_request, ion_qr_scanner, ion_quote, ion_radio_waves, ion_record, ion_refresh, ion_reply, ion_reply_all, ion_ribbon_a, ion_ribbon_b, ion_sad, ion_sad_outline, ion_scissors, ion_search, ion_settings, ion_share, ion_shuffle, ion_skip_backward, ion_skip_forward, ion_social_android, ion_social_android_outline, ion_social_angular, ion_social_angular_outline, ion_social_apple, ion_social_apple_outline, ion_social_bitcoin, ion_social_bitcoin_outline, ion_social_buffer, ion_social_buffer_outline, ion_social_chrome, ion_social_chrome_outline, ion_social_codepen, ion_social_codepen_outline, ion_social_css3, ion_social_css3_outline, ion_social_designernews, ion_social_designernews_outline, ion_social_dribbble, ion_social_dribbble_outline, ion_social_dropbox, ion_social_dropbox_outline, ion_social_euro, ion_social_euro_outline, ion_social_facebook, ion_social_facebook_outline, ion_social_foursquare, ion_social_foursquare_outline, ion_social_freebsd_devil, ion_social_github, ion_social_github_outline, ion_social_google, ion_social_google_outline, ion_social_googleplus, ion_social_googleplus_outline, ion_social_hackernews, ion_social_hackernews_outline, ion_social_html5, ion_social_html5_outline, ion_social_instagram, ion_social_instagram_outline, ion_social_javascript, ion_social_javascript_outline, ion_social_linkedin, ion_social_linkedin_outline, ion_social_markdown, ion_social_nodejs, ion_social_octocat, ion_social_pinterest, ion_social_pinterest_outline, ion_social_python, ion_social_reddit, ion_social_reddit_outline, ion_social_rss, ion_social_rss_outline, ion_social_sass, ion_social_skype, ion_social_skype_outline, ion_social_snapchat, ion_social_snapchat_outline, ion_social_tumblr, ion_social_tumblr_outline, ion_social_tux, ion_social_twitch, ion_social_twitch_outline, ion_social_twitter, ion_social_twitter_outline, ion_social_usd, ion_social_usd_outline, ion_social_vimeo, ion_social_vimeo_outline, ion_social_whatsapp, ion_social_whatsapp_outline, ion_social_windows, ion_social_windows_outline, ion_social_wordpress, ion_social_wordpress_outline, ion_social_yahoo, ion_social_yahoo_outline, ion_social_yen, ion_social_yen_outline, ion_social_youtube, ion_social_youtube_outline, ion_soup_can, ion_soup_can_outline, ion_speakerphone, ion_speedometer, ion_spoon, ion_star, ion_stats_bars, ion_steam, ion_stop, ion_thermometer, ion_thumbsdown, ion_thumbsup, ion_toggle, ion_toggle_filled, ion_transgender, ion_trash_a, ion_trash_b, ion_trophy, ion_tshirt, ion_tshirt_outline, ion_umbrella, ion_university, ion_unlocked, ion_upload, ion_usb, ion_videocamera, ion_volume_high, ion_volume_low, ion_volume_medium, ion_volume_mute, ion_wand, ion_waterdrop, ion_wifi, ion_wineglass, ion_woman, ion_wrench, ion_xbox, ]; -} diff --git a/ionicons/ioniconsTests/generateAllIconCodesArray.sh b/ionicons/ioniconsTests/generateAllIconCodesArray.sh deleted file mode 100755 index 48be59f..0000000 --- a/ionicons/ioniconsTests/generateAllIconCodesArray.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# This will create an array of NSStrings representing all the icon unicode values. -# This is mainly useful for testing, in order to ensure that all of the codes offered by -# the library actually show a glyph. - -SCRIPT_PATH="$(dirname "$0")" || . -CODES_PATH=$SCRIPT_PATH/../../ionicons/ionicons-codes.h -OUTPUT_PATH=$SCRIPT_PATH/allIconCodes.h - -if [[ -f "$OUTPUT_PATH" ]]; then - rm "$OUTPUT_PATH" -fi - -echo '//' > $OUTPUT_PATH -echo '// AUTOGENERATED' >> $OUTPUT_PATH -echo '//' >> $OUTPUT_PATH -echo '// This file is auto-generated by generateAllIconCodesArray.sh' >> $OUTPUT_PATH -echo '// It contains all icon codes for testing purposes.' >> $OUTPUT_PATH -echo '//' >> $OUTPUT_PATH -echo '' >> $OUTPUT_PATH -echo '#import ' >> $OUTPUT_PATH -echo '#import ' >> $OUTPUT_PATH -echo '' >> $OUTPUT_PATH -echo 'static NSArray *allIconCodes() {' >> $OUTPUT_PATH - -OUTPUT_STRING="return @[" -while read line; do - OUTPUT_STRING=${OUTPUT_STRING}"$(echo $line | awk -F ' ' '{print $2}'), " -done <$CODES_PATH -OUTPUT_STRING="${OUTPUT_STRING}];" - -echo ${OUTPUT_STRING} >> $OUTPUT_PATH -echo "}" >> $OUTPUT_PATH diff --git a/ionicons/ioniconsTests/ioniconsTests.m b/ionicons/ioniconsTests/ioniconsTests.m deleted file mode 100644 index 15652a1..0000000 --- a/ionicons/ioniconsTests/ioniconsTests.m +++ /dev/null @@ -1,173 +0,0 @@ -// -// ioniconsTests.m -// ioniconsTests -// -// Created by sweetman on 5/1/17. -// Copyright © 2017 David Sweetman. All rights reserved. -// - -#import -#import "allIconCodes.h" -#import "IonIcons.h" -#import "FontInspector.h" -@import CoreText; - -@interface IonIcons() -// expose a private method: -+(UIColor*)defaultColor; -@end - -@interface Example_ioniconsTests : XCTestCase -@end - -@implementation Example_ioniconsTests - -- (void)testForValidFontName -{ - UIFont* fontName = [IonIcons fontWithSize:15.0]; - XCTAssertNotNil(fontName); -} - -/** - * Enumerate all of the icon names provided in ionicons-codes.h and ensure that they actually corresond - * to a glyph in the icon font. allIconCodes() is a an array autogenerated by a Run Script build phase - * populated with all of the icon names. - */ -- (void)testIconNamesReturnGlyphs { - NSArray *iconNamesArray = allIconCodes(); - UIFont *font = [IonIcons fontWithSize:10.0]; - - for (NSString *iconName in iconNamesArray) { - BOOL exists = [FontInspector doGlyphsReferencedInString:iconName existInFont:font]; - XCTAssertTrue(exists, - @"This iconName references a character that doesn't exist in this font: %@", iconName); - } -} - -- (void)testBadNamesReturnNoGlyphs { - NSArray *badNames = @[@"q", @"what", @"ion-ionic", @"\u039E", @"\u04FA", @"\U0001F30D"]; - UIFont *font = [IonIcons fontWithSize:10.0]; - - for (NSString *name in badNames) { - BOOL exists = [FontInspector doGlyphsReferencedInString:name existInFont:font]; - XCTAssertFalse(exists, - @"This string should not return a valid glyph from this font."); - } -} - -- (void)testThatImageIsRenderedAtSize { - CGFloat iconSize = 32.0; - UIImage* img = [self imageWithIconSizeTheSameAsImageSize:iconSize]; - XCTAssertEqual(img.size.width, iconSize); - XCTAssertEqual(img.size.height, iconSize); -} - -- (void)testThatIconAndImageSizeAreDistinct { - CGFloat iconSize = 32.0; - CGFloat imageSize = 45.0; - UIImage* imgWithImageSize = [self imageWithIconSize:iconSize imageSizeWithEqualHeightAndWidthLength:imageSize]; - XCTAssertTrue(imgWithImageSize.size.width == imageSize && - imgWithImageSize.size.height == imageSize); -} - -- (void)testThatSizeAllowsNonSquare { - CGFloat iconSize = 32.0; - CGFloat imageWidth = 44.0; - CGFloat imageHeight = 54.0; - UIImage* imgWithDifferentHeightAndWidth = [self imageWithIconSize:iconSize - imageSize:CGSizeMake(imageWidth, imageHeight)]; - XCTAssertEqual(imgWithDifferentHeightAndWidth.size.width, imageWidth); - XCTAssertEqual(imgWithDifferentHeightAndWidth.size.height, imageHeight); -} - -- (void)testImageForNonNil { - XCTAssertNotNil([self imageWithIconSizeTheSameAsImageSize:32.0]); - XCTAssertNotNil([self imageWithIconSize:32.0 imageSizeWithEqualHeightAndWidthLength:45.0]); - XCTAssertNotNil([self imageWithIconSize:32.0 imageSize:CGSizeMake(44.0, 54.0)]); -} - -- (void)testImageColor { - UIImage* imgOfSize = [self imageWithColor:[UIColor redColor]]; - XCTAssertFalse([self checkImage:imgOfSize forColor:[UIColor greenColor]]); - XCTAssertTrue([self checkImage:imgOfSize forColor:[UIColor redColor]]); - - UIImage* iconOfImgSize = [self imageWithColor:[UIColor redColor] imageSize:CGSizeMake(32.0, 43.0)]; - XCTAssertFalse([self checkImage:imgOfSize forColor:[UIColor greenColor]]); - XCTAssertTrue([self checkImage:iconOfImgSize forColor:[UIColor redColor]]); -} - -- (void)testDefaultImageColor { - UIImage* iconWithNilColor = [self imageWithColor:nil imageSize:CGSizeMake(12.0, 12.0)]; - XCTAssertTrue([self checkImage:iconWithNilColor forColor:[IonIcons defaultColor]]); -} - -#pragma mark - Utility - -/** - * Look through an image's pixels for a given color. - * Return when we've found the first matching pixel or reached the end. - */ -- (BOOL)checkImage:(UIImage*)image forColor:(UIColor*)color -{ - CGFloat r,g,b; - [color getRed:&r green:&g blue:&b alpha:NULL]; - BOOL match = NO; - - CGImageRef imageRef = [image CGImage]; - NSUInteger width = CGImageGetWidth(imageRef); - NSUInteger height = CGImageGetHeight(imageRef); - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - NSUInteger bytesPerPixel = 4; - NSUInteger bitsPerComponent = 8; - NSUInteger bytesPerRow = bytesPerPixel * width; - uint8_t *rawData = (uint8_t*) calloc(height * width * bytesPerPixel, sizeof(uint8_t)); - CGContextRef context = CGBitmapContextCreate(rawData, width, height, - bitsPerComponent, bytesPerRow, colorSpace, - kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); - CGColorSpaceRelease(colorSpace); - - CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); - CGContextRelease(context); - - for (NSUInteger x = 0 ; x < width ; x++) { - for (NSUInteger y = 0; y < height; y++) { - - NSUInteger byteIndex = (bytesPerRow * y) + x * bytesPerPixel; - CGFloat thisR = (rawData[byteIndex] / 255.0); - CGFloat thisG = (rawData[byteIndex + 1] / 255.0); - CGFloat thisB = (rawData[byteIndex + 2] / 255.0); - - if (thisR == r && thisG == g & thisB == b) { - match = YES; - break; - } - } - if (match) { break; } - } - - free(rawData); - - return match; -} - -- (UIImage*)imageWithIconSizeTheSameAsImageSize:(CGFloat) size { - return [IonIcons imageWithIcon:ion_alert size:size color:[UIColor whiteColor]]; -} - -- (UIImage*)imageWithIconSize:(CGFloat)iconSize imageSize:(CGSize)imageSize { - return [IonIcons imageWithIcon:ion_alert iconColor:[UIColor whiteColor] iconSize:iconSize imageSize:imageSize]; -} - -- (UIImage*)imageWithIconSize:(CGFloat)iconSize imageSizeWithEqualHeightAndWidthLength:(CGFloat)imageSize { - return [IonIcons imageWithIcon:ion_alert iconColor:[UIColor whiteColor] iconSize:iconSize imageSize:CGSizeMake(imageSize, imageSize)]; -} - -- (UIImage*)imageWithColor:(UIColor*)color { - return [IonIcons imageWithIcon:ion_alert size:32.0 color:color]; -} - -- (UIImage*)imageWithColor:(UIColor*)color imageSize:(CGSize)imgSize { - return [IonIcons imageWithIcon:ion_alert iconColor:color iconSize:32.0 imageSize:imgSize]; -} - -@end