Open kimasendorf opened 5 years ago
@kimasendorf Sorry for not including Carthage or instructions on how to use it. Will add Carthage tomorrow.
So to get it running in 30sec what you do is:
http://eon.codes/blog/2017/11/08/local-frameworks/
Do Step 1 until 5. Just don't name it AwesomeLib, Name it Utils.
Let me know if you get stuck. I will try to help. π
The reason we use .framework is so that you don't have to compile all the files on every run.
This library is meant more as a pick and choose lib. I use many parts of it in other projects. Almost never the whole thing. I have a Tester project that has the entire lib, for whenever I want to clean it up or add things.
Hey, thanks for the info. Do you add each packages from their single repository? I saw their are many cross references. Will try the .framework wrapper, sounds useful =)
I break out libs on a need by need basis.
If you want to use the Constaint lib. You need Constraint.swift, Alignment.swift and ConstraintKind.swift. FYI: the constraint lib wil get its own repo soon, and will be re-branded to Spatial π
If you just want to try the entire Utils lib out. You can just downloader and drag it into xcode. And start ising everything.
Hey, thanks for the info. Do you add each packages from their single repository? I saw their are many cross references. Will try the .framework wrapper, sounds useful =)
One more stupid question, which Swift version do you use?
There are no stupid questions π. I USE the latest swift version so that should be 4.2. I just upgraded to Mojave so im not 100%
I just installed High Sierra and Xcode 10.0. It comes with Swift 4.2.
I get many compiler errors.. Thought I have to use 4.1 but it seems really hard to get an older version working..
AS far AS i know there ahould not be huge differences in warnings between 4.1 and 4.2 i will give it a spin at the office today in Mojave. Iβm still moving atom.io prefs and setting up My os config. So a bit behind atm.
@kimasendorf Alrighty, here we go. 4.2 πΈ I tested it in Mojave + Xcode 10.0 + swift 4.2 all tests run. https://github.com/eonist/swift-utils/commit/395e8b83575821efbd53736172f06e344d609da3
Great! There is one error left in swift-utils/Sources/Utils/misc/layout/menu/CustomMenuItem.swift
override func validateMenuItem(_ menuItem:NSMenuItem) -> Bool {
//override in subclass (optional)
return true
}
Method does not override any method from its superclass
There are also still errors in swift-utils/Sources/Utils/text/utils/format/TextFormatUtils.swift
and in swift-utils/Sources/Utils/geom/path/ns/NSBezierPathParser.swift.
They are easy to fix..
However, I put all code in a framework but the framework just has an objective-c header file.. Do I need to create some sort of swift index file and import all file I need?
I will try to Add the code to a new project and see if there stil are bugs. Also I will make an on boarding wiki page with some gifs explaining the steps to build from frameowork. Itβs dead simple but you have to sort of have an overview look.
Thanks a lot =)
@kimasendorf Updated the files that threw an error and made better on boarding for using the lib, http://eon.codes/blog/2018/09/30/Manually-adding-a-lib/
Will update the build from framework article with gifs later today.
@kimasendorf As promised, I added gif videos the explains the steps to build from a framework file: http://eon.codes/blog/2017/11/08/local-frameworks/ in your case you would just need to name the target Utils and then use import Utils
in subsequent code that wants to use the Utils code.
Great, all errors are gone.
Still not able to get the framework approach right. I created a framework and added the utils, but I think it needs a root file or something?
If you do the steps in the local framwork article exactly AS they are sone in the GIFs it should work. This is how you would menes any framework, not just this.
But in your post you just add a function to the framework and no files. I mean I've created a framework and added all files and wasn't able to use any func after import..
Notice that you have to prefix import with @testable. You also need reach the correct class/instance scope . I.e ArrayParser.count([7,9,7]) //output:3
I added the swift-utils as submodule to a test project. When I simply try to compile it without writing any additional code I get a bunch of errors in ./swift-utils/Sources/Utils/misc/layout/alignment/Align.swift.
All the CG datatypes are undeclared.
I assume there is an import of
Foundation
missing.