Three20 competitors/alternatives - ios

I see three20 a very powerful lib, spicily because Facebook and Twitter use it. I just want to know if there are any competitors/alternatives for Three20? or even simple.

nimbus seems to be a project that will address some of the issues.

I use Three20 a lot, but I'm always in search of an alternative, because Three20 is not a lightweight framework and because importing only a few features of Three20 is not practical. But I don't know any good alternative. If you only need a few features I prefer to write my own code for it or use another library.
For some features of Three20 I know other libraries that does the same thing. It's always a better way to use small libraries, because of file size and side-effects.
UILabel with styled text: OHAttributedLabel
Load and cache images asynchroniously: ImageLoader
Pull to refresh on a table view: PullToRefresh
In addition to this list you can have a look at TapkuLibrary which adds features like CoverFlow or a CalendarView to your app.
Finally GitHub is always a good resource, when you search libraries for special features.

Check this list of iOS controls.
You'll find over 200 open source custom controls there. I've used some of them (star rating, confirm button), it's lightweight and easy to embed. Check that the license suits your needs before though!

THree20 is one of the few libs but if you look around github you can find plenty of sample ios projects with source code to learn from and adapt to your app.

Three20 provides a lot of useful wrapper to facilitate development. It's biggest advantages and until know nothing could replace it.

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.

Is it possible to design native iOS user interface with the CSS?

I'm interested in such a thing - are there some tools, libraries, etc which will allow to design native iOS UI (UILabels margins, etc.) with the help of CSS? I am not talking about libraries such as PhoneGap or Appcelator. I'm interested in something like CSS parser which will allow me to transform CSS code into Objective-C UI code or Interface Builder.xib files. Let's say I have a good web-designer fluent in CSS and HTML and I want him to write UI code for my iOS application in CSS+HTML and then I transform it in Objective-C UI code or IB .xib files.
I think my question is clear and I hope for some good answers.
Services that allow you to design "native apps" or, more accurately, "hybrid apps" are actually bare bones app dominated by a web view or frame for a webpage so that you provide content and styling on a website that is being displayed by the app. It expands the capabilities of the "app" and allows you to put an app in the store but it is not on a par with true native apps.
There is no elegant conversion from HTML to Objective-C.
Seriously, if you want a native app, make an actual native app. Otherwise, just stick with a web app.
http://www.nativecss.com/docs/tutorials/intro/ios
for native ios development,it is very good tutorial for ios+CSS
Also check out: http://www.pixate.com/
It's not free but let's you do exactly what you're looking for.
The reason for PhoneGap, AppCelator etc. to exist is the reason that HTML+CSS (in other words "web pages") cannot be converted into Objective-C easily.
I suggest you take the straightforward way. Teach your designer to use the Interface Builder. It's just a WYSIWYG editor, nothing complicated even for a designer.

Using Syntax Highlighting

I'm trying to write an IDE for the iOS and I stumbled on a problem. I of course wanted to be able to do syntax highlighting, but I have no idea how I have to get this to work.
I have been googling over a month now, but I haven't found anything useful. Most libraries are C++. That I find no problem, I know enough of C++, but they all use the Boost libraries and I heavily doubt if it's easy to install them on a jailbroken iOS device, or even compile them for the iOS on the Mac.
So I come here for help. What should I do? Should I use a PHP syntax highlighter, which always colors the whole document? Should I write a syntax highlighter my self, that doesn't use the Boost library? Or does somebody here know another library, which can be used on the iOS?
Thank you in advance,
ief2
i have a simillar problem about syntax highlighting, but i prefer to solved it using UIWebview than using core text, because that is a different pixel in rendering text in core text and UITextview (in my problem i was using a core text view that cover by uitextview), and then i try to solved using uiwebview, even i'm still on developing but i can say that it is better using uiwebview than core text, maybe you can take a look at this link http://alexgorbatchev.com/SyntaxHighlighter/ it is an open source code, but it develop using javascript.
Most Boost libraries are header-only. There are only a few Boost libraries, like those for threading and asynchronous I/O, that use a compiled library. If you've found some solutions that would work fine aside from your worries about using Boost, then I would look at them again, as they'll likely work. Even if you must use a Boost library that is not header-only, you can always build it as a static library and link that into your application, so that in the end the only thing that needs to be installed is just your app bundle.
I know this is old, but in case anybody is looking for a complete syntax highlighter for iOS, there's two options:
Highlightr: A Swift library for syntax highlighting, supports hundreds of languages but uses JS as backend. It's fast enough for live editing, though. (Disclaimer: I am the creator of this library).
SyntaxKit: A native solution on early stages of development. Should support any TextMate syntax in the future.

Three20 framework with line-height?

somebody knows if it's possible to set a specific line-height for three20-styled texts?
thanks
There is no easy way to achieve decent line spacing on TTStyledText. It is really very noticeable when you use non-standard fonts at larger sizes. However you can get it working with a lot of hacking using TTStyledLayout and categories. Look at internal functions that modify _lineHeight and in particular
- (void)inflateLineHeight:(CGFloat)height
- (TTStyledFrame*)addFrameForText:(NSString*)text element:(TTStyledElement*)element ...
My version is way too messy to release but if someone had the time to do a clean implementation it would be a great addition to three20 (copy and paste would be a nice-to-have also)

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