Use of three20 framework in ios programming - ios

I am working on old project there use of three20 framework but i don,t know about three20, So please tell me about it deeply?
what will we can use instead of three20 in current time?

I've also fondly used Three20 on numerous projects and tried hanging on to it for a while. However, iOS8 causes numerous runtime errors / crashes on my Three20 projects. It's actually surprising to see how much functionality still works but you're strongly advised to not use it. There's no real community behind it anymore and no one is maintaining / supporting it.
I'm migrating to NimbusKit - it's developed by some of the original developers of Three20. They also have a good migration guide.

The old Three20 GitHub project is still available, with all of the code and samples still intact on a different branch.
See the "Articles" folder for documentation, and "samples" for sample projects.

Related

How to correctly build a swift framework for iOS

My goal is to build a swift iOS framework which uses two other frameworks (included as separate projects) and which shouldn't reveal the source code after built.
Is there some text/guide/documentation which would explain and navigate me through the process of building such a framework properly and correctly?
I built framework with aggregate target adding and linking frameworks on which my custom framework is dependent using run script as indicated here. I was able to add built of my custom framework to my custom app, together with other two dependencies (again as a separate projects), and run it on the device. However, I am not convinced by the correctness of my custom framework built.
Moreover, I was not able to upload the archive to the Appstore due to the various errors of "Unsupported architectures...", "CFBundleIdentifier Collision...", "Invalid Bundle...", "Invalid Binary" and so on. After sorting these errors out according to the various stackoverflow answers and installing the app from the TestFlight, the app crashed after launch and wasn't working at all.
I was checking various blog posts, stackoverflow questions/answers and Apple Framework Programming Guide but nothing gave me comprehensive understanding on building custom framework under conditions described above.
Everything I did was just following step-by-step tutorials without explanation of the purpose of the steps. I am sure I am missing the basics. Could you please help me and give me some guides?
I can understand you frustration. I, a while ago too searched probably for many documents on how to write a framework correctly but like you I also didn't find anything really that satisfying. From my own experiences I can give a couple of advices.
NO External Libraries
In my opinion DO NOT use external libraries in your own framework. I don't really know what your frameworks purpose is but most of the stuff you want to do can be done without using external libraries. Depending on other libraries is not a good idea especially if its a framework you are working on. Anytime these libraries get updated or even worse if they don't you will have to wait for them to be updated or find another library.So rather than this happening later on I think its better if you do it from the start. So loose the external libraries.
Universal Framework Binary
Second one is pretty easy. Generating a universal framework. I suggest you don't use a script. Most of the scripts I found were either outdated or they didn't work at all. Later on I found out that actually it was pretty easy to generate one on your own. You can do this by building your project once for a real device and one for the simulator.Then you can generate a universal binary by using the command lipo -create "Your simulator executable path" "your iOS device executable path" -output "your framework name". What this does is that it combines your two executable files and generates a universal one. Then you can just go and copy your simulator documents from the modules file and paste them in you iphoneos modules file. I am going to share a link were you can go through the walkthrough yourself. https://medium.com/wireless-registry-engineering/create-a-universal-fat-swift-framework-b7409bbfa18f
Use Objective-C(If you can)
This one is bit of a tricky one unless you know objective-c. What I would recommend is that you implement your framework using Objective-C and writing a swift wrapper around it. I would not have said this if you were creating an iOS app but in case of a framework I still think you should go for objective-c. This is because Objective-c has been around for over 30 years and most of the very old apps are in objective-c. If you want your framework to easily be used by older apps coded in objective-c I recommend you go with it. I have read tons of posts on how people have problems trying to use frameworks written in swift in their objective-c apps. Swift will be the first and probably only choice in the near future but not just yet. On the plus side if you still haven't you will have learnt Objective-C which will give definitely give you a better understanding on how things work. It will be challenging but I promise you it will be worth your while .I have a good read on this which you can checkout yourself. https://academy.realm.io/posts/altconf-conrad-kramer-writing-iOS-sdk/
Naming Conventions
This is a pretty straight forward one. I suggest you stick to apples naming conventions. This is because you will be sharing your code this time and people will look for familiarity when trying to integrate your framework. This will make your code easier to understand. You can check out these two links for more info.https://github.com/raywenderlich/objective-c-style-guide (obj-c) https://github.com/raywenderlich/swift-style-guide (swift)
Access Control
This in my opinion is an important one. When working on you framework think before you implement a class or a function. Consider if you would like someone else to be able to use that part of your code. You may want to limit the user while they use your framework and correct access control is the way to do it. You can easily guide the users so the users do exactly what you want them to do with your framework.
Document Your Code
This is a must if you want your framework be a professional one. You should be documenting every function and variable the user will use. Documenting and explaining what your code does makes a lot of peoples lives easy. You don't one anyone trying to understand what your code does for half an hour while you could have easily written a small explanation for what the parameters do and one that function or variable should be used for.
Test Your Code
Last but not least do write tests for your code. This does take some time but it assures you that your code works the way it should.
Look at other good frameworks
You should definitely checkout other open source libraries and look at what they have done. Usually there is no point in reinventing the wheel unless you are doing something absolutely different but even then there are very familiar ways to do things. I can suggest you check out the mantle sdk(https://github.com/Mantle/Mantle). Another one is the very popular Alamofire sdk(https://github.com/Alamofire/Alamofire) and also the Realm sdk(https://github.com/realm/realm-cocoa). These are good examples of frameworks. Take a look at them. Look how they have done things. It will give you an insight on how your framework should look like.
I know all of these points may also be valid if you were writing an app but what makes these a must is the fact that you will be sharing your code with others. You may manage by not doing some of these while implementing an app but for a framework things do change a little bit. It is always a pleasure to work with easy to use frameworks which make coding a pleasure. These types of small things will make your framework preferable. Happy coding.

Basic Mechanics of iOS Frameworks and Xcode (and Swift)

I think I just must be stupid.
I'm having a lot trouble understanding very basic things concerning frameworks in Xcode/iOs/Swift. While I've certainly gotten some things to work, I've gotten more and more confused about what I'm actually doing. And the documentation on the web just confuses me more.
When I see discussions about how to import particular frameworks (e.g. https://github.com/danielgindi/Charts is the library I'm playing with, but I've seen this pattern repeated in other libraries) they seem to always tell me include the Xcode project file as a child project of my project, in addition to linking things as an embedded binary. This confuses me. Is it not possible to link an already compiled framework to my project without including all the source code of the project?
That is, can't I just take a library.framework file, and add it to my embedded libraries list and be done with it?
In the frameworks I've played with (again https://github.com/danielgindi/Charts is my primary example, but this is true in many others I've played with) I can't seem to use the framework without Carthage or CocoaPods. For me at this stage, that is just confusing... I accept that they are useful tools to automate a difficult process, but I'd really like to understand what that process actually is before I let a tool automate it for me. As I search the web I just seem to always be led back to these tools as being the correct way to do things.
So here are my questions.
If I find a framework library on the web... do I need its source code or can I somehow just link to a compiled version of the framework?
In my reading, it seems that libraries made with Swift are somehow second-class citizens because Swift is a newer thing. Is that still the case? (The articles I read about this seems to date from 2014-2015).
Is there are good place to understand how Apple expects me to add a framework to a project, without using CocoaPods or Carthage?
No need to add source code. Just add the framework to Target ->
General -> Linked Framework and Libraries -> Tap on + and select
your framework.
In my opinion, many new libraries are being written is Swift. So you won't be left behind for using swift.
Apple has documentation about adding frameworks to XCode. But I would suggest to use Cocoapods , as its easy to manage libraries.
Cheers :)

Known issues for iOS modularized approach?

We've a classic iOS application which was developed using objective-c and it has lot of features. The same features has been used for other similar apps as well.
Now we've plan to rewamp the entite application. One of the approach to reduce the development work, we've plan to modularize features as framework re-using the same objective-c code, so that all applicaiton can use the framework and compile time will be less.
Also as part of rewamp, we will be using iOS 10 and swift3.
Please kindly share me your ideas/feedback, what are issues will be popup or any limitaion to do this approach.
Appreciate your help!
Thanks,
Srini
Just pack it as cocoapods and deploy into your company git is the fastest way i suppose, packing into framework is also fine but it have many boilerplate thing like cant run on either device or simulator, and if using fat framework then need to extract the simulator part out when you archive, or have to use embed framework if they are depent on each other,.... its just pretty annoying

Adding Cocos2d to existing project

I would like to appologize in advance however I think this question is overlooked. I have a project I have been working on and I would like to incorporate coco2d. How can I implement the coco2d-iphone-2.0 download. All the tutorials I have tried have either been outdated or left me with errors.
I keep getting ARC Semantic Issue and ARC Restriction once I follow steps of other tutorials to add coco2d to an existing project.
Thus, could someone be so kind as to put a step but step approach to adding the latest stable version of coco2d to an already existing project.
Sorry if this seems trivial.
I think the easiest way would be through cocoapods. have a look at this web site http://cocoapods.org/

CPAN/gem-like repository for Objective-C and Cocoa?

Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.?
In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick "gem install" away in Ruby.
There's a project for that! It's called CocoaPods!
Homepage: http://cocoapods.org/
Source: https://github.com/CocoaPods/CocoaPods
Unfortunately not :(
There are some very useful sites however. I find one of the best is cocoadev.com as it contains lots of useful information about many of the more obscure classes usually including snippets of code to do some really cool things :)
Maybe we (the cocoa community) should look into building something like this!
Oh and I just remembered this site cocoadevcentral.com which is also very good for starting out with cocoa.
Daniel mentioned http://cocoadev.com.
More specifically, check out http://www.cocoadev.com/index.pl?ObjectLibrary.
"This page is for tracking re-usable Cocoa classes that can be mixed, matched, and dropped fairly easily into existing Cocoa projects to add useful functionality."
I'd be interested in what kind of "basic functions" you're having to implement. There's actually quite a lot already there in the provided libraries, and I wonder if you're just not finding functionality that's already there...
There's a new index of reusable code for Mac OS and iOS: Cocoa Objects
I might be confused or missing something here... But doesn't apple provide all the Foundation / Cocoa / AppKit / CoreAudio / Qtkit / etc libraries that should provide all of the very basic functions you are looking for?
Other than what xcode comes with or is on the apple dev site, there are no centralized repo's for Cocoa.
Google Code also has some objective C things up. It depends on what you are looking for...
Also see GitHub, many useful Objective-C projects, especially re iPhone. See activerecord & cocoaoniguruma, for instance.
http://github.com/search?q=objective-c
http://github.com/search?q=objc
Google has Google toolbox for mac which got me started unit testing my iPhone application which was the main thing I found missing.

Resources