Comments (7)
Hey Christopher!
Swift types are namespaced by their module names. The full name of the class is actually Squeal.Database
, but the compiler only requires the namespace when there is a conflict.
But if you really hate the name, you can always create a typealias:
typealias SquealDB = Squeal.Database
var db = SquealDB()
Does this calm your cringes? After years of having to prefix classes with XYZ (due to the lack of namespaces), I'm pretty happy to not have the name of my project in my class names anymore.
from squeal.
The things I was reading about the automatic namespacing behaviour seemed to indicate that it was a minefield, but if I can personally just use Squeal.Database
where others might conceivably just use Database
I suppose that'll be just fine.
It seems obvious now that the problem isn't that your class isn't namespaced, it's that the namespacing is, depending on your perspective, either all loosey goosey or groovily transparent. From my Ruby background I'm definitely going with the former :-D
Thanks for the quick feedback!
from squeal.
No problem!
Out of curiosity, where have you been reading about issues with automatic namespacing? I know that at the LLVM layer, modules don't deal with collisions. Objective-C modules, for example, don't prevent collisions. But I thought that the Swift compiler does force authors to deal with collisions.
from squeal.
I personally haven't had problems, simply because I'm so very very very new to Swift. My thought process was as follows: (1) I want to use SQLIte (2) Few minutes of googling later, I find Squeal. Awesome. (3) Bang my head against the wall for a few hours trying to write the most basic of classe and most trivial of tests (4) Take a break to look at the Squeal API (5) See that the entry point is just a "Database" class. (6) Google around for swift and namespacing, find only woe and gnashing of teeth (7) Complain about class name (8) Discover that explicit namespacing is optional, and curse the language gods
from squeal.
I must be dumber than a two year old because I'm getting "No such module 'Squeal'" if I import Squeal
and "Use of undeclared type 'Squeal'" if I don't. I'm starting to regret giving iPhone dev another try.
from squeal.
I think you're running into the same issue in #14. The long and short: you need to ensure your app is linked against the Squeal framework. I should've updated the docs sooner :/
iOS development definitely has a steeper initial learning curve, especially if you're coming from a completely different toolset. But once you get yourself oriented there's a lot of great things to build and enjoy.
from squeal.
I did iOS dev for a year back in 2011/2012 and as long as I could stay in the code and the APIs I was golden. The moment I had to do anything in xcode... oy.
Hallelujiah adding the framework did the trick. Well, for that problem at least :P
from squeal.
Related Issues (20)
- Missing required module 'sqlite_3_osx HOT 2
- Issue with Xcode 6.3 - Swift 1.2 HOT 1
- Some typos in "README.md"
- "execute" with parameters. HOT 1
- Launch app using Squeal on my device HOT 1
- Can't put Database in another folder as App HOT 3
- Xcode 6.3.1: App using Squeal crashes when run on device, but works in emulator HOT 1
- Failed to Code Sign Squeal-iOS HOT 4
- Swift 2.0 Compatibility HOT 8
- Swift 2 query method equivalent HOT 5
- Documentation Swift 2 HOT 2
- Missing required module 'sqlite3_ios' HOT 1
- Insert or replace
- Cannot compile with whole module optimization
- Creating Database on Disk Issue HOT 1
- Swift3 under Xcode 8 HOT 2
- Swift 3 error: duplicate symbol _SQUEAL_TRANSIENT
- swift-2.3 branch: fails to do archive for generic ios devices
- Any chance of codable support being introduced to the library? HOT 2
- Migration: Table already exists
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squeal.