2

I have no clue how to start , so I also do not have any code. My research so far pointed out, that there is no standard functionality and this has to be coded by our self ?

any hint or confirmation ?

enter image description here

Update using CoreTextArcView, which was suggested by Ashish.

Thanks for helping. The sample Project which was suggested works for me. I can see the blue circle with text on it. But with integrating this into my project, I have problems. I did the following

  1. I added the Files "CoreTextArcView.h" and "CoreTextArcView.m" into my Project. I can see them in the explorer to the left.

  2. In my BridgingHeader.h I added to import : #import "CoreTextArcView.h"

  3. I added the Codesample :

    var arctext : CoreTextArcView = CoreTextArcView(frame: CGRectMake(50, 50, 200, 200), font: UIFont.systemFontOfSize(15), text: "Hello this is radious arc with text", radius: 85, arcSize: 130.0, color: UIColor.redColor()) arctext.backgroundColor = UIColor.clearColor() self.view.addSubview(arctext)

-> I get compile errors in CoreTextArcView.m:

/Users/user/Desktop/Prototypes/CoreTextArcView.m
/Users/user/Desktop/Prototypes/CoreTextArcView.m:99:14: 'release' is unavailable: not available in automatic reference counting mode
/Users/user/Desktop/Prototypes/CoreTextArcView.m:99:14: ARC forbids explicit message send of 'release'
/Users/user/Desktop/Prototypes/CoreTextArcView.m:100:21: 'retain' is unavailable: not available in automatic reference counting mode
/Users/user/Desktop/Prototypes/CoreTextArcView.m:100:21: ARC forbids explicit message send of 'retain'
/Users/user/Desktop/Prototypes/CoreTextArcView.m:144:33: Cast of Objective-C pointer type 'NSAttributedString *' to C pointer type 'CFAttributedStringRef' (aka 'const struct __CFAttributedString *') requires a bridged cast
/Users/user/Desktop/Prototypes/CoreTextArcView.m:190:63: Cast of C pointer type 'CTFontRef' (aka 'const struct __CTFont *') to Objective-C pointer type 'UIFont *' requires a bridged cast
/Users/user/Desktop/Prototypes/CoreTextArcView.m:298:37: Cast of C pointer type 'CTFontRef' (aka 'const struct __CTFont *') to Objective-C pointer type 'id' requires a bridged cast
/Users/user/Desktop/Prototypes/CoreTextArcView.m:307:24: 'autorelease' is unavailable: not available in automatic reference counting mode
/Users/user/Desktop/Prototypes/CoreTextArcView.m:307:24: ARC forbids explicit message send of 'autorelease'

any help ?

mcfly soft
  • 11,289
  • 26
  • 98
  • 202

1 Answers1

2

By using this library : https://github.com/javenisme/CurvaView

var arctext : CoreTextArcView = CoreTextArcView(frame: CGRectMake(50, 50, 200, 200), font: UIFont.systemFontOfSize(15), text: "Hello this is radious arc with text", radius: 85, arcSize: 130.0, color: UIColor.redColor())
arctext.backgroundColor = UIColor.clearColor()
self.view.addSubview(arctext)

enter image description here

Remove arc for one file like as follows (set -fno-objc-arc to that library's .m file from build phases of your project target) :

enter image description here

Ashish Kakkad
  • 23,586
  • 12
  • 103
  • 136
  • Thanks a lot. This helps a lot. Before I accept one question. So is there no out of the box functionallity with swift. – mcfly soft Jul 02 '15 at 07:37
  • The sample Project from github worked for me. Thanks. But with integrating this into my Project, I have problems/errors. I would be happy if someone could review my integration steps I did. I updated the question. – mcfly soft Jul 02 '15 at 07:58
  • @mcflysoft yes, I have the same issue. I have solved because this library has no arc. I have updated the answer. – Ashish Kakkad Jul 02 '15 at 08:59