alemar11 / CountryKit

A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and emoji.
http://www.alessandromarzoli.com/CountryKit
MIT License
28 stars 5 forks source link

resulting CountryKit.framework is almost 100mb #13

Open shengchl opened 3 years ago

shengchl commented 3 years ago

I believe there should be a notice somewhere in the readme as people may use this library in mobile app context where such size is absolutely unacceptable.

alemar11 commented 3 years ago

@shengchalover do you have a .framework to share? In my tests the size is around 22Mb

alemar11 commented 3 years ago

adding the library via SPM (just implemented) results in a CountryKit_CountryKit.bundle of 22.4Mb.

shengchl commented 3 years ago

I will be able to provide more info tomorrow but on Xcode 12.4 + Cocoapods (iOS project) it builds to ~94mb with Assets.car taking 99% of that space.

the json description of that archive contains lots of data like this:

  {
    "AssetType" : "Image",
    "BitsPerComponent" : 8,
    "ColorModel" : "RGB",
    "Colorspace" : "srgb",
    "Compression" : "lzfse",
    "Encoding" : "ARGB",
    "Idiom" : "universal",
    "Name" : "ac",
    "NameIdentifier" : 45030,
    "Opaque" : false,
    "PixelHeight" : 480,
    "PixelWidth" : 640,
    "Preserved Vector Representation" : true,
    "RenditionName" : "ac.pdf",
    "Scale" : 1,
    "SHA1Digest" : "561D05A5FFC0A19311180C7CCB7F6B94373E3DC2",
    "SizeOnDisk" : 71708,
    "State" : "Normal",
    "Template Mode" : "automatic",
    "Value" : "Off"
  }

so I believe somehow we have lots of flags within that archive taking all the space

I use xcrun --sdk iphoneos assetutil --info Assets.car to get the description