Optional protocol methods in Swift

In Swift it’s kind of unsupported to implemented optional protocol methods. You can, which is ugly, use the @objc syntax: @objc protocol MyProtocol { optional func doSomething(); } class MyClass : MyProtocol { // no error } Another disadvantage here is that structs are unsupported, as you’re bridging for Objc. Using protocol extensions to create … 

 

Launch time performance optimization

Time for a small post about launch time performance optimization. I did some research in improving the launch time of my current app. I started creating a main.swift file, removed @UIApplicationMain from my AppDelegate and added this line to my main.swift: let StartTime = CFAbsoluteTimeGetCurrent() Resulting in this complete file: // // main.swift // // … 

 

Moya with SwiftyJSON using Moya-SwiftyJSONMapper

I’ve just released Moya-SwiftyJSONMapper which makes it really easy to map MoyaResponse to a struct or model inheriting from the ALSwiftyJSONAble protocol in combination with SwiftyJSON. Model creation with SwiftyJSON After you’ve created your model: import Foundation import Moya_SwiftyJSONMapper import SwiftyJSON final class GetResponse : ALSwiftyJSONAble { let url:NSURL? let origin:String let args:[String: String]? required … 

 
Follow on Feedly