Is it possible to write iPhone app in both objective c and swift - ios

My existing iOS app is in objective c language and i want to add more functionality in my app and i want to do that code in swift language.
So is it possible to create an app which contains both the languages(i.e. in objective c & swift) and Is my app will work fine?

In short answer, Yes.
If you have existing project written in objective-c then you can add new classes written in swift. You still have choice if you want to use swift 3.0 ot swift 2.0.
You have to use bridge class in order to achieve that. You will get more guide on Link provided on Apple website.
https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html
However going forward it would make sense that you spend more time on Learning Swift as Apple is now leaning towards Swift 3.0.
Here is link quick guide.

Related

Started React Native With Swift Instead Of Objective C

So I started a react native app using create-react-native-app and it created a lot of boilerplate code. Android is in JAVA which I am fine with. But the iOS is in Objective-C and I am more familiar with Swift. Is there anything I can do about that? I know most of my code is going to be in JavaScript anyways, but just wondering anyways.
Unfortunately, there is not a simple or one command way to convert your iOS code in your React Native project from Objective-C to Swift. However if you want to write a Native Module, which you'll need to eject from CRN or start a new project with react-native init, you can write new code in Swift.
You might also be interested in this post on how to bridge Swift and Objective-C code. Basically when you create a new swift file you need to make sure to select “Create Bridging Header” when prompted.
You're problem is not that clear. But lemme say this if you wanted to work on cross platform then react native is a good choice to that if you wanted to use javscript. Regarding on your question which is , lemme quote "But the IOS is in Objective C" which is you're wrong you can write an iOS native using both objective c , even c and c++ , ..and swift which you say your familiar with and if you're avoiding objective c then you can write iOS app purely in swift. Hope that helps.
Tips
1 for cross platform - and you want js (react native)
2. cross platform and you wanted to use c# (Xamarine)
3. iOS app which is native (Swift or objective c) or both
4. hybrid , you can try framework like ionic, cordova etc.
5. let us include android , you can use java(kotlin
You can convert swift to objective c or objective c to swift.
There are bunch of options for that, If you want to use javascript for converting than use obj2swift.js: https://github.com/okaxaki/objc2swift.
If you want to convert your code online than you can use online language converter like swiftify:
https://swiftify.com/#/converter/code/

DJI SDK - Sample tutorials in Swift

I was going through the DJI SDK and looking through the sample tutorials like TapFly and ActiveTrack Missions etc. but could only find the code in Objective C. Although they have mentioned that the code is available in Swift but I couldn't find it. Also, if it's only available in obj c, can I use the bridging header for the code using without making many changes in obj c while running my app coded in swift?
Everything in the MSDK-iOS is compatible with your Swift app

UIHierarchyView in Swift

I have converted a project from the attached link to Swift UIHierarchyView for Objective C – iOS platform
As I don't have a very good knowledge in Swift, I am looking for some help who can review this code and guide me further to make this project stable.

Can we build and upload ios app with swift and objective-c mixed code?

Actually, I am working on one app and started with the objective-c. Now i have started working on swift with the same app for the further development and it will work with both the class (objc and swift).
Now I have doubt that it will accept by apple store or not.
Please help me.
This is fine, Apple provides the mechanisms for interacting with both and will not drop support for Objective-C for quite sometime. Many large organisations still have the majority of their code written in Obj-C (including Apple) so they need to give people time to transition, they aren't going to switch over immediately to a relatively immature language.
You can use Swift and Objective-c together. There is no issue in it. You need to create a bridging header file.
Please read this
Swift and Objective-C in the Same Project

iOS 9, Swift 2.0 , Xcode and testing

I am planning to learn to develop iOS apps. I'll most probably be learning Objective-C only for now and would like to develop some actual apps for iOS.
Now, with the launch of Swift 2.0, will Objective-C apps still run on iOS9 ? Also, is it possible to test run an Objective-C app on your phone like mentioned here ? https://developer.apple.com/xcode/
Or is this facility available only for apps written in Swift?
Does Swift allow me to do everything that Objective-C does?
Any further advide or guidance for what should I know before enrolling for the course will be appreciated to help me judge things better.
Swift is still just the second language. All Cocoa frameworks are written in C or Obj-C (maybe the new ones in iOS 9 are written in Swift).
The language in which an application is written doesn't matter, the code is compiled into the same machine code, so yes, Obj-C apps will continue to run and many developers won't bother with Swift. Apps that have been already written will not have to be rewritten to Swift (with some exceptions).
Swift won't allow you to do absolutely everything that Obj-C does but it will allow you to do almost everything and the code will be probably more robust, considering that Swift is more modern language with stronger typing than Obj-C. If you are a beginner, you won't probably find any problematic use case.

Resources