Giter Site home page Giter Site logo

Help please about swifterswift HOT 25 CLOSED

swifterswift avatar swifterswift commented on May 17, 2024
Help please

from swifterswift.

Comments (25)

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev did you add "import SwifterSwift" to the top of the file?

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

No. But let today = Date().beginning(of: .day)! work without import. And startDate = today.adding(.year, value: -1) too

And then I write let someString = String(" 123 ").trimmed Xcode not found error. Xcode found error then I try build application

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev some time some extensions don't work without import, please import SwifterSwift at every file you want to use it in, and let me know if you still have the problem

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

import SwifterSwift - No Such module 'SwifterSwift'
I add directory 'Extensions' manually.

"Manually
Add the extensions folder to your Xcode project to use all extensions, or a specific extension."

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev and if you didn't clean and rebuild the project from the "Product" menu after installing the pod, it's also preferred to do that

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev Then please make sure to check "Copy items if needed" and "Add to targets" checkboxes when adding the files to your xcode project

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

2016-12-12 10 58 42

Not work. In edit mode XCode found and show trimmed extension

2016-12-12 11 00 49

When build - error

2016-12-12 11 01 36

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev I think the code should be
let someString = String(" 123 ")?.trimmed
or
let someString = String(" 123 ")!.trimmed

trimmed is a String extension not a String? extension
Please try adding ? or ! and let me know if this fixes the problem

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

Not work
2016-12-12 11 05 45

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev 🤔, are you using xcode 8 with swift 3?
if yes, could you please try isEmail, or any other method to see if the problem is about the entire swift extensions, or just trimmed

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

Of course. :-)
2016-12-12 11 16 27

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

DateExtensions work good, UITableViewExtensions too, trouble only with StringExtensions

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev Then I assume the StringExtensions.swift file is not added to the target, could you please delete it, and re-add it to project while making sure to add it to target and copy if needed viewcontroller_swift

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

I add the entire directory "Extensions", so it is unlikely that some files were added as DateExtensions, and some do not. But it's good. Will make again.
2016-12-12 11 27 15
2016-12-12 11 28 58
2016-12-12 11 30 03

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

2016-12-12 11 32 35

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev weird!! , the StringExtensions.swift file follows the same structure of all other extensions files, and it is public

is this code working for you?
let someString = String(" 123 ")!.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev I'm trying to understand what is causing the problem in your end, I've tested this with multiple projects, as I see in the first picture you sent the autocompletion is completing the trimmed for you, which means xcode can see the file!
do you have another string method or property called trimmed somewhere else in your project?

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

Yes. Look second string.
2016-12-12 11 38 31
Had to pull it out Stringextension. Works.
Must be let rt = region.trimmed

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev is the problem solved ?

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

do you have another string method or property called trimmed somewhere else in your project?

I have not tried everything. Reverse() does not work.
2016-12-12 11 43 41
2016-12-12 11 44 06

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev I don't know what is happening in your end, everything is working correctly for me, I'd be glad to check it myself with teamviewer if you want
you can send me login info to [email protected]

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

is the problem solved ?

I replaced trimmed on trimmingCharacters. It worked, but hardly a solution to the problem.

You want to connect via TeamViewer?

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev I'll try to check what is causing the problem if you want via teamviewer

from swifterswift.

KBMatveev avatar KBMatveev commented on May 17, 2024

Send password via eMail

from swifterswift.

omaralbeik avatar omaralbeik commented on May 17, 2024

@KBMatveev Glad your problem is fixed, I think the problem is when adding files from the file menu, they didn't get added to target for some reason, dragging the files to the project, always shows you the confirmation menu, where you can double check that files are added to your target

from swifterswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.