Skip to content

Translate pod into a Swift version - #1

Open
brunomunizaf wants to merge 1 commit into
reden87:masterfrom
brunomunizaf:master
Open

Translate pod into a Swift version#1
brunomunizaf wants to merge 1 commit into
reden87:masterfrom
brunomunizaf:master

Conversation

@brunomunizaf

Copy link
Copy Markdown

This PR translates the pod into a Swift version.
The example has also been substituted.

@reden87 reden87 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@brunomunizaf you should do a few changes before allowing the PR.
Also I couldn't run the example project so I did not check the R87AttributedString.swift file yet, please fix the following and commented problems so I can check the important things :)

General:

  • update README file
    • it should show Swift code example
    • the iOS compatibility should be updated also
  • update the podspec file (the platform version should be modified in the s.platform line)

Example related:

  • the Pod folder and the R87AttributedString.xcworkspace file should be removed from source control, they are generated with the pod install command
  • the Podfile is not valid, there should be a target in it
  • the Podfile does not contain a target iOS version
  • the project has some serious errors when I open it:

Xcode folder structure error screenshot

After you fix these I'll try the example and comment on the R87AttributedString.swift file if necessary.

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please remove all unnecessary code from here

<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

no need for multiple orientations in the example project, use only Portrait

override func viewDidLoad() {
super.viewDidLoad()

let attributedString = NSMutableAttributedString.init(string: "*Bruno* #Muniz# $Aze-ve-do$")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You should use the original TermsOfUse.txt JSON file in the example project, it shows a real use case. You can check how the original example looked like in the Screenshots folder

import UIKit

class ViewController: UIViewController {
@IBOutlet weak var label: UILabel!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

private

// Copyright © 2017 bmaf. All rights reserved.
//
import UIKit
public extension NSMutableAttributedString {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This file should not exist in the project. The R87AttributedString.swift file should be loaded with CocoaPods and should be removed from the example project's folder completely.

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.

2 participants