Skip to content

Implement basic initializers of NSAttributedString #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 14, 2016
Merged

Implement basic initializers of NSAttributedString #297

merged 4 commits into from
Apr 14, 2016

Conversation

eyeplum
Copy link
Contributor

@eyeplum eyeplum commented Mar 23, 2016

Implemented and tested the following methods (and properties):

  • public var string: String
  • public var length: Int
  • public init(string str: String)
  • public init(string str: String, attributes attrs: [String : AnyObject]?)
  • public init(attributedString attrStr: NSAttributedString)

The implementation is based on CFAttributedString.


public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {

private var _cfAttributedString: CFAttributedString!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would make NSAttributedString to be a has-a versus an is-a relationship to CFAttributedString; which is a variation (however it probably does not matter since there are not any CF apis that could take a attributed string.

It would be better to have this not be null resettable; removing the ! would be preferable.

@phausler
Copy link
Contributor

phausler commented Apr 4, 2016

@swift-ci Please test

eyeplum added 4 commits April 12, 2016 18:52
The implementation is based on CFAttributedString
`test_initWithAttributedString` was not included in
TestNSAttributedString.allTests previously
@parkera
Copy link
Contributor

parkera commented Apr 14, 2016

@swift-ci please test

@parkera parkera merged commit 03d534c into swiftlang:master Apr 14, 2016
@parkera
Copy link
Contributor

parkera commented Apr 14, 2016

Hm, looks like this caused a build failure on Ubuntu 14.04:

Test Suite 'TestNSAttributedString' started at 21:17:42.655
Test Case 'TestNSAttributedString.test_initWithSimpleString' started at 21:17:42.655
Test Case 'TestNSAttributedString.test_initWithSimpleString' passed (0.0 seconds).
Test Case 'TestNSAttributedString.test_initWithComplexString' started at 21:17:42.655
Test Case 'TestNSAttributedString.test_initWithComplexString' passed (0.0 seconds).
Test Case 'TestNSAttributedString.test_initWithSimpleStringAndAttributes' started at 21:17:42.655
/home/buildnode/jenkins/workspace/oss-swift-incremental-RA-linux-ubuntu-14_04/swift/utils/build-script-impl: line 2193: 44723 Segmentation fault      LD_LIBRARY_PATH="${INSTALL_DESTDIR}"/"${INSTALL_PREFIX}"/lib/swift/:"${build_dir}/Foundation":"${XCTEST_BUILD_DIR}":${LD_LIBRARY_PATH} "${build_dir}"/TestFoundation/TestFoundation

@parkera
Copy link
Contributor

parkera commented Apr 14, 2016

parkera added a commit that referenced this pull request Apr 14, 2016
@parkera
Copy link
Contributor

parkera commented Apr 14, 2016

I reverted the commit for now...

@eyeplum
Copy link
Contributor Author

eyeplum commented Apr 14, 2016

@parkera I will look into that, thanks.

@eyeplum eyeplum deleted the nsattributedstring branch April 29, 2016 04:06
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
add note about swift file recognition to vim-lsp section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants