قالب وردپرس درنا توس
Home / IOS Development / # 312: Improvements to the Active Directory 🎨 – Little Bites of Cocoa

# 312: Improvements to the Active Directory 🎨 – Little Bites of Cocoa



Subjects

Topics

Asset Catalogs have existed for some Xcode releases. They are a great way for us to organize and configure graphic assets (among many other things) for our app. Today, we are reviewing the improvements to Asset Catalogs in Xcode 9 . Let's go diving.

First up, colors .

Yes, we can now define and organize named colors inside an Asset Catalog ! [19659005] We can select "New Color Set" and then use all the common features of Asset Catalogs including new Wide Gamut support.

cold "wood" )

Tidy!

The second major addition we are going to look at is "real" support for vector-based resource .

By Xcode releases, we were able to add image objects to our catalogs with a format of PDF . This worked well, but under the hood Xcode would only render our asset on @ 1

x @ 2x and @ 3x sizes and save non-vector (i.e. .png images) into the app's bundle.

In Xcode 9 however, we get a beautiful new checkbox named "Preserve Vector Data" .

This means that if our image is loaded into our code and we ask you to display it in a larger size than it's default, it will be scaled up at

     [ ] [] [] [ image    19659014]:    UIImage  ( name :    "cocoapod" ). ) 
  normal    tintColor    =    UIColor  ( entitled :    "cov Fefe" ) 

  display .   addSubview  (  normal ) 

  la    large     =    UIImageView  ( image :    UIImage  ]  named :    "cocoapod" ). 
  large    tintColor    =    UIColor  ( the name  :    "cream" ). 
                 CGRect  [ x :    50     :    200     width :    normal  [19659011] boundaries    size ~~ POS = HEADCOMP    width    *    2     height     normal    boundaries .   size ~~ POS = HEADCOMP .   height    *    2 ) 

  display  .   addSubview  (  big [19659014]) 

[19659005] Very, very fun.


Source link