قالب وردپرس درنا توس
Home / IOS Development / New in Swift, October 2015

New in Swift, October 2015



Something new! I will try to relinquish our traditional Objective-C -> Swift format. To start, there are many interesting Swift libraries that appear, as I try to work on a regular basis on Twitter but you may want to miss them there, dear reads. I would like to summarize the best every month with a post here.

Instructions

  Instructions

Training marks are a little questionable in the app design world. The proposal is that your app design should be ready enough for users to know what everything does without being "coached" through it. I do not have a clear YES / NO opinion about using them personally … I've used apps that explain each part of their user interface with excerpts that are excessive. I bet that minimal use of these could contribute nicely to your app.

My primary reason to include this is how amazing it is. You can easily see an app that adds this component and make these brands of finest designed part of the app.


Unbox

Unbox is a JSON decoder that requires minimal set-up of boilerplate and has recently been updated to Swift 2. It really does not get any easier than this:

  struct    User     unboxable    {   la    name:    string 
      la    age:    Int 

      init  (unboxer:    unboxer)    ]  .name    =    Unboxer .unbox (  "Name" ) 
          Self  .age    =    unboxer.unbox (19659027) "age" ) 
    } 
 } 

UIStackViewPlayground

I knew that stabbings (new in iOS 9 SDK) should be powerful, but this collection of playgrounds really neglect the point home. It turns out how to create the iOS calculator view, a more detailed scientific calculator view, a fairly standard profile view, tweet view, mailbox view, and iOS display.

I'm convinced that stabling views can create something. Now, I can only convince all my users to upgrade to iOS 9 so I can use them.


RateLimit & AwesomeCache

Here is a related couple. AwesomeCache is a simple Swift cache that lets you put things away for later, but with a very nice outlet mechanism:

   cache.setObject (  "Alex"     Forkey:    "name"     expires:  . Seconds 19659048] 60    *    60    *    24 ))    // expires in one day 

I use this all the time to cache API calls to data such as rarely changes. It may use some updating to be more Swifty and smaller NSKeyedArchiver -y but it will do for now.

For more short-term and ephemeral caching, try RateLimit that will only run a block as often as you specify. The example given is a perfect example: say you're updating a page in viewDidAppear: and you will not overdo it when users are constantly moving back and forth from a list to a detailed screen. Wrap that is updated in a block set to 60 seconds, and the screen only grabs new data every minute.

] {
// Gjør RateLimit.execute (Name: "RefreshTimeline" some work that goes maximum once a minute
}


It's all for this episode. Keep tabs through the month on Twitter or follow up every month here for a quick summary.




Source link