Re: iOS Pages app UI Widget question.
Re: iOS Pages app UI Widget question.
- Subject: Re: iOS Pages app UI Widget question.
- From: John Joyce <email@hidden>
- Date: Thu, 9 Dec 2010 08:46:39 +0900
On Dec 9, 2010, at 6:05 AM, colo wrote:
> On Wed, Dec 8, 2010 at 3:57 PM, Conrad Shultz
> <email@hidden> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 12/8/10 12:50 PM, colo wrote:
>>> Hi apologies if I have the incorrect mailing list.
>>>
>>> I am looking to build a sample app that utilizes the feature in Pages
>>> like Apps for a Box Shape object with four NE SE SW NW corner control
>>> resizing handles.
>>> In various books I have read up on drawing closed UI Bezier Paths in
>>> various books but have yet to find a deeper doc or example code for
>>> iOS illustrating how to create these extra controls are implemented.
>>
>> I don't think there is a standard framework component providing such
>> capabilities (please let me know if there is).
>>
>> The Cocoa with Love blog has a nice sample desktop app that implements
>> this feature among others. It's written with Core Graphics so should be
>> pretty portable to iOS with relatively minor changes:
>>
>> http://cocoawithlove.com/2008/07/coregraphics-curves-and-lines-sample.html
>>
>> This is something that interests me as well, so I'd love to hear your or
>> others' solutions.
>>
>> - --
>> Conrad Shultz
>>
>> Synthetiq Solutions
>> www.synthetiqsolutions.com
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.7 (Darwin)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iD8DBQFM//FHaOlrz5+0JdURAuOxAJwIM+cNgCNfGdWB60pVDzLc790f+ACeO9WN
>> X60OXrqj5rg58zwOD6qpMLg=
>> =m/4Z
>> -----END PGP SIGNATURE-----
>>
>
> Thank you for that. I'll look at it. It might be a bit over my head
> still. There must be some doc that I have missed however cause there
> are sure a lot of apps in the app store that have worked out these
> i'll call them Pages"widget" from now on. Wether they are
> reimplementing each one by hand or use common code base I would love
> to know.
>
> It sounds odd if each Dev has had to re-implement the wheel over and
> over again for the very common tool, in secret no less!
>
> Nick
> ____________________________________________
Nick,
These are called Bezier curves. They are used in vector art programs.
Cocoa already provides the ability to draw such things.
However, the control handles or control points (terms established by Adobe with their quite famous Illustrator program) are something left to you to implement.
It's not terribly difficult to do. They represent points that relative to the end points of the line, define the curvature.
You might also want to look at DrawKit
http://apptree.net/drawkit.htm
DrawKit is OpenSource for Cocoa not CocoaTouch, but you can learn more about creating custom buttons and controls there.
Basically, you would need to implement an object that is not completely trivial, and different implementations may be faster/smoother to interact with.
If Apple provided this kind of object to everyone, you would see way too many apps using it where it isn't needed.
It's a cool thing to implement for learning though.
Core Graphics is used for performance.
You could do your own in straight Cocoa, but you may find it is a bit deeper rabbit hole in that you'll need to learn a lot more about Cocoa/Core Graphics/OpenGL drawing etc... in order to build it.
You'll want to understand it. Break down the view into it's components conceptually. _______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden