Thursday, May 21, 2015

swift: Using UIApplication Subclass in main.m

Make the swift class like this

import UIKit
import Foundation
@objc(MyTest2) class MyTest2: UIApplication
{
    
    
  
    

}

and modify the main.m
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "test3-swift.h"  //test3 is the project name, not a real file in project
int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, NSStringFromClass([MyTest2 class]), NSStringFromClass([AppDelegate class]));
    }
}

No comments:

Post a Comment