• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting tab stops in swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting tab stops in swift


  • Subject: Re: setting tab stops in swift
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 27 Aug 2015 17:47:24 -0700

> On Aug 27, 2015, at 5:32 PM, Boyd Collier <email@hidden> wrote:
>
> I’ve tried
> 	let theTabStop: NSTextTab = NSTextTab(NSLeftTabStopType, loc, (tabInterval * cnt))
>
> but am told that NSLeftTabStopType is an “unresolved identifier”, which I understand has to do with enums being quite different in swift.
> Surely, the correct way to deal with this is relatively simple, but I’ve not yet come up with it.  Any help would be greatly appreciated.

Command-click on ’NSTextTab’ to see the Swift definition. The first parameter to init isn’t a tab stop type, it’s an NSTextAlignment. (The Obj-C code you’re porting seems to be wrong, but it probably doesn’t matter because the correct enum has the same numeric value…) Command-click on NSTextAlignment and you’ll see the enum value you want is called just ‘Left’.

—Jens
_______________________________________________

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


  • Follow-Ups:
    • Re: setting tab stops in swift
      • From: Boyd Collier <email@hidden>
References: 
 >setting tab stops in swift (From: Boyd Collier <email@hidden>)

  • Prev by Date: setting tab stops in swift
  • Next by Date: Re: setting tab stops in swift
  • Previous by thread: setting tab stops in swift
  • Next by thread: Re: setting tab stops in swift
  • Index(es):
    • Date
    • Thread