This will do it:
[[NSOperationQueue mainQueue] addOperationWithBlock:^ {
//Your code goes in here
NSLog(@"Main Thread Code");
}];
More Related Contents:
- Is it possible to opt your iPad app out of multitasking on iOS 9
- Transport security has blocked a cleartext HTTP
- iPhone get SSID without private library
- How can I add NSAppTransportSecurity to my info.plist file?
- How to select Multiple images from UIImagePickerController [duplicate]
- Cordova app hanging during startup on iOS 10
- AnyObject not working in Xcode8 beta6?
- How to create .ipa file using Xcode?
- How to create radio buttons and checkbox in swift (iOS)?
- Xcode 7.3: import Module displayed with strikethrough
- iOS 7 App Icons, Launch images And Naming Convention While Keeping iOS 6 Icons
- Phonegap CDVViewController.h file not found when Archiving for iOS
- UITextView – setting font not working with iOS 6 on XCode 5
- Is there a way to compile for ARM rather than Thumb in Xcode 4?
- Entitlements file do not match those specified in your provisioning profile.(0xE8008016)
- Xcode Simulator: how to remove older unneeded devices?
- Xcode 6 isn’t autocompleting in Swift
- Refresh devices in team provisioning profile managed by Xcode 7?
- The supportedInterfaceOrientations method doesn’t override any method from its superclass
- Need assistance setting two buttons of equal width, side by side Autolayout
- What is the second parameter of NSLocalizedString()?
- Swift: How to open a new app when UIButton is tapped
- How to convert a NIB-based project to a Storyboard-based? [closed]
- Simulator slow-motion animations are now on?
- How to Add iPhoneX Launch Image
- After updating iOS, all applications using the framework stopped running on the device, but they run on the simulator
- What does get-task-allow do in Xcode?
- React-native iOS not showing images (pods issue)
- Pod install command with error
- how to add animation to launch screen in iOS 9.3 using Objective c