Why can't we access Apple's implementation files? [duplicate] - ios

This question already has answers here:
Where is the source code for NSObject.m? [closed]
(3 answers)
Closed 6 years ago.
I am learning about Objective-C runtime. I can access to NSObject.m root class to see how it works but I can not acces to NSProxy.m or UITableView.m files.
Why does Apple enable access to some implementation files and others not?
I've searched in Google but I haven't found anything.

Actually, you don't have access to any of Apple's Cocoa source code. It's secret.
You may have found online some open source version of NSObject (for the Darwin project or OpenStep / GNUStep or similar), but that is not Apple's Cocoa source code.
Apple may choose to provide an open source version of some of their code, e.g. http://www.opensource.apple.com/. But even then you don't really know what they are using under the hood.

Related

Different AppDelegate and Storyboard files for different targets [duplicate]

This question already has answers here:
How do I manage building a Lite vs Paid version of an iPhone app?
(6 answers)
Closed 4 years ago.
I have an XCode Project(iOS App for only iPhones) and I want to use same codebase for publishing different application. I have to change icon, name and design for this second application. Therefore, I did not use Localization.
Also in codebase, I need some variables to hold different keywords for different targets.
Is there any way to do it or I have to clone same project and change this files after?
Thanks.
Take a look at this question.
StackOverFlow Question
You will have to convert the code to swift but this gives you the basics to get started.
One workspace, two app targets, one set of code files.
Alternatively, use a framework. In that case it might be one workspace and two complete Xcode projects plus the framework.

Binary compatibility of different versions of Swift [duplicate]

This question already has answers here:
Swift compatibility between versions for a library
(2 answers)
Closed 6 years ago.
We are developing an iOS framework using Swift 2.2. This framework is intended for outside use, i.e., its built binary will be distributed to our clients, and they will use it to develop their applications.
Another update: Swift 3 will not have ABI compatibility. See here: https://www.infoq.com/news/2016/05/swift-3-no-stable-abi.
So if we author the framework in Swift, and the only way to guarantee our clients using different versions of Swift can consume it safely is to build multiple versions of the framework, and ask them to download the version that matches theirs, right?
From Apple's documentation.
Swift 2.3 and Swift 3 are not binary compatible so your app's entire
code base needs to pick one version of Swift.
Also here is a similar question that you may find helpful.

In the osx/ios world, what is a library and what is a framework? [duplicate]

This question already has answers here:
What is the difference between a framework and a library? [closed]
(22 answers)
Closed 8 years ago.
I am learning development on osx and ios. So far, coding is ok. The most difficult is to handle all the files, all the configuration issues (of xcode), and so on. I thought hearing from a guru about libraries/frameworks would help me a lot!
I would like to know more about libraries and frameworks.
What is a library, what is a framework (and what's the difference between them)?
Where can I find a list of all the frameworks (of all the libraries?)? Or: what are the most important frameworks?
What can I do without any framework?
Your first question is very well explained here
Finding the right frameworks is half the fun coding with iOS. There are loads of lists out there and depending on what you are doing there are some frameworks that are very used. One great tool to look at is cocoapods. It can not only help you find frameworks but it also manages the frameworks in your project. Adding cocoapods in my opinion should be the fist thing you do in a project. All that said, my three favorite frameworks are:
AFNetworking: To handle network requests.
RestKit: To transform JSON into objects. (it's actually built on top of AFNetworking)
SVProgressHUD: A lightweight progress HUD
Finally you can do everything without ever using an external framework but why would you recode something that is already coded and battle tested.
In addition to my comment, some informations about frameworks on OS X/iOS.
A framework on OS X/iOS is a bundle used to distribute shared resources, including library code, resource files, header files… For more details see
A list of system frameworks available on OS X here

How to hide code in implimentation file in iOS [duplicate]

This question already has answers here:
How to build a framework or library for other developers, the secure way? [closed]
(3 answers)
Closed 8 years ago.
I have a developed a generic class and I want to give it to one of my friend.
How can I hide the code so that he should not view the logic in that. Can I do something like apple does by giving us only the .h files.
Please help me in achieving this. Thanks.
you need to create your own static library i.e. .a file in xcode. And it is not very tough, you can do this in just in few mins.
Read this tutorial and try in out:
How to make Universal Static library (.a file) in iOs using xCode
You will have to make your own library (framework) for this.
You can search about it there are many tutorials about that. One of them is How to build a framework or library for other developers, the secure way?
Edit: Great Tutorial
Creating Static Libraries For iOS

Check if an application is installed or not in no jailbreak iOS device [duplicate]

This question already has answers here:
How to check programmatically if an App is installed?
(6 answers)
Closed 9 years ago.
There're duplicated questions somewhere but they don't inform that device is no jailbreak.
In there any way to check that an application is already installed or not?
You can use the library appList to get a list of installed apps and packages, available for free on Cydia (source on GitHub: https://github.com/rpetrich/AppList). With it you can query apps/packages by bundle id. There's an example in the Github repo, or here's a related answer on SO: https://stackoverflow.com/a/10328585/381233.
(I think the OP is correct about there not being questions like his asked here already, the 2 questions listed in the comments currently don't mention Jailbreak.)

Resources