• 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
Substring in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Substring in Swift


  • Subject: Substring in Swift
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Fri, 02 Sep 2016 16:17:30 +0700

How to translate this into Swift (current version, i.e. the one before 3.0):

UITextView *uitv = …
NSRange selectedRange = uitv.selectedRange;
NSString *textString = uitv.string;
NSString *selectedString = [ textString substringWithRange: selectedRange ];

Looks simple, but I have now tried for more than one hour.

Gerriet.


_______________________________________________

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: Substring in Swift
      • From: Jim Adams <email@hidden>
    • Re: How to Open Dictionary
      • From: Cosmo Birch <email@hidden>
  • Prev by Date: Re: How to Open Dictionary
  • Next by Date: Re: How to Open Dictionary
  • Previous by thread: Re: How to Open Dictionary
  • Next by thread: Re: How to Open Dictionary
  • Index(es):
    • Date
    • Thread