Przeglądaj źródła

* Created Sync class.
* Comments all over the code.

Iñigo Valentin 9 lat temu
rodzic
commit
92ddbbf93a

+ 20 - 4
MenuCollectionViewCell.swift

@@ -1,12 +1,28 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  MenuCollectionViewCell.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Inigo Valentin on 30/09/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import UIKit
+
+/**
+ Extension of UICollectionViewCell for the main menu.
+ */
 class MenuCollectionViewCell: UICollectionViewCell {
     
     @IBOutlet weak var label: UILabel!

+ 16 - 0
app.xcodeproj/project.pbxproj

@@ -19,6 +19,8 @@
 		93D9EA681DE342AC00089002 /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9EA671DE342AC00089002 /* UIView.swift */; };
 		93D9EA6A1DE3491100089002 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9EA691DE3491100089002 /* HomeView.swift */; };
 		93D9EA6C1DE3498500089002 /* HomeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93D9EA6B1DE3498500089002 /* HomeView.xib */; };
+		93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D9EA701DE37C7900089002 /* libsqlite3.tbd */; };
+		93D9EA761DE3ACBB00089002 /* Sync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9EA751DE3ACBB00089002 /* Sync.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -36,6 +38,8 @@
 		93D9EA671DE342AC00089002 /* UIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIView.swift; sourceTree = "<group>"; };
 		93D9EA691DE3491100089002 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
 		93D9EA6B1DE3498500089002 /* HomeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeView.xib; sourceTree = "<group>"; };
+		93D9EA701DE37C7900089002 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
+		93D9EA751DE3ACBB00089002 /* Sync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sync.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -43,6 +47,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -54,6 +59,7 @@
 			children = (
 				93B84B981D9C31AB006C0F67 /* app */,
 				93B84B971D9C31AB006C0F67 /* Products */,
+				93D9EA6F1DE37C7900089002 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -81,10 +87,19 @@
 				93D9EA631DE273FD00089002 /* Section.swift */,
 				93D9EA691DE3491100089002 /* HomeView.swift */,
 				93D9EA671DE342AC00089002 /* UIView.swift */,
+				93D9EA751DE3ACBB00089002 /* Sync.swift */,
 			);
 			path = app;
 			sourceTree = "<group>";
 		};
+		93D9EA6F1DE37C7900089002 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				93D9EA701DE37C7900089002 /* libsqlite3.tbd */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -162,6 +177,7 @@
 			files = (
 				93D9EA641DE273FD00089002 /* Section.swift in Sources */,
 				93D9EA6A1DE3491100089002 /* HomeView.swift in Sources */,
+				93D9EA761DE3ACBB00089002 /* Sync.swift in Sources */,
 				93B84B9C1D9C31AB006C0F67 /* ViewController.swift in Sources */,
 				93B84B9A1D9C31AB006C0F67 /* AppDelegate.swift in Sources */,
 				93B84BA21D9C31AB006C0F67 /* app.xcdatamodeld in Sources */,

BIN
app.xcodeproj/project.xcworkspace/xcuserdata/seavenois.xcuserdatad/UserInterfaceState.xcuserstate


+ 18 - 6
app/AppDelegate.swift

@@ -1,10 +1,22 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  AppDelegate.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Inigo Valentin on 28/09/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import UIKit
 import CoreData
@@ -18,8 +30,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
         // Override point for customization after application launch.
         
-        //Set a one line for collectionView
-        
         return true
     }
 
@@ -48,6 +58,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     }
 
     // MARK: - Core Data stack
+    
+    //Check: Why is this here?
 
     /*lazy var persistentContainer: NSPersistentContainer = {
         /*

+ 0 - 1
app/Base.lproj/Main.storyboard

@@ -199,7 +199,6 @@
                     <view key="view" contentMode="scaleToFill" id="12o-6g-8cT" customClass="HomeView" customModule="app" customModuleProvider="target">
                         <rect key="frame" x="0.0" y="0.0" width="0.0" height="380"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" red="0.9425276964" green="1" blue="0.35931510379999998" alpha="1" colorSpace="calibratedRGB"/>
                     </view>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="jry-8b-RWd" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 30 - 21
app/HomeView.swift

@@ -1,17 +1,38 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  HomeView.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Iñigo Valentin on 21/11/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import Foundation
 import UIKit
+
+/**
+ Class to handle the home view.
+ */
 class HomeView: UIView {
     
+    //The main scroll view.
     @IBOutlet weak var scrollView: UIScrollView!
+    
+    //The container of the view.
     @IBOutlet weak var container: UIView!
+    
+    //Each of the sections of the view.
     @IBOutlet weak var locationSection: Section!
     @IBOutlet weak var lablancaSection: Section!
     @IBOutlet weak var futureActivitiesSection: Section!
@@ -20,18 +41,19 @@ class HomeView: UIView {
     @IBOutlet weak var pastActivitiesSection: Section!
     @IBOutlet weak var socialSection: Section!
     
+    /**
+     Run when the view is started.
+    */
     required init?(coder aDecoder: NSCoder) {
         
-        print("HomeView: init")
         super.init(coder: aDecoder)
         
+        //Load the contents of the HomeView.xib file.
         Bundle.main.loadNibNamed("HomeView", owner: self, options: nil)
         self.addSubview(container)
         container.frame = self.bounds
         
-        
-        
-        //Set titles
+        //Set titles for each section
         locationSection.setTitle(text: "Encuentranos")
         lablancaSection.setTitle(text: "La Blanca")
         futureActivitiesSection.setTitle(text: "Proximas actividades")
@@ -41,13 +63,6 @@ class HomeView: UIView {
         socialSection.setTitle(text: "Siguenos")
         
         //Always at the end: update scrollview
-        //var contentRect: CGRect = CGRect.zero;
-        //for view in scrollView.subviews {
-        //    contentRect = contentRect.union(view.frame);
-        //}
-        //self.scrollView.contentSize = contentRect.size;
-        
-        
         var h: Int = 0
         for view in scrollView.subviews {
             //contentRect = contentRect.union(view.frame);
@@ -55,11 +70,5 @@ class HomeView: UIView {
             print("curh: \(h)")
         }
         self.scrollView.contentSize.height = CGFloat(h);
-        
-        //let lastView : Section! = scrollView.subviews.last as! Section!
-        //let height = lastView.frame.size.height
-        //let pos = lastView.frame.origin.y
-        //let sizeOfContent = height + pos + 10
-        //scrollView.contentSize.height = sizeOfContent
     }
 }

+ 1 - 1
app/HomeView.xib

@@ -107,7 +107,7 @@
             </subviews>
             <constraints>
                 <constraint firstItem="Poy-ba-9jX" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" identifier="HomeView.Scroll.Width" id="91y-2B-LO2"/>
-                <constraint firstItem="Poy-ba-9jX" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="20" symbolic="YES" identifier="HomeView.Scroll.Top" id="Oqf-OH-F61"/>
+                <constraint firstItem="Poy-ba-9jX" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" identifier="HomeView.Scroll.Top" id="Oqf-OH-F61"/>
                 <constraint firstItem="Poy-ba-9jX" firstAttribute="height" secondItem="iN0-l3-epB" secondAttribute="height" identifier="HomeView.Scroll.Height" id="j3N-FA-cWS"/>
             </constraints>
             <point key="canvasLocation" x="26" y="52"/>

+ 33 - 4
app/Section.swift

@@ -1,27 +1,56 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  Section.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Iñigo Valentin on 21/11/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import Foundation
 import UIKit
+
+/**
+  Extension of UIView to be formatted as sections.
+ */
 class Section: UIView {
     
+    //The container.
     @IBOutlet weak var container: UIView!
+    
+    //The section title.
     @IBOutlet weak var title: UITextView!
+    
+    //The content of the section.
     @IBOutlet weak var content: UIView!
     
+    /**
+     Run when the section is loaded.
+    */
     required init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)
         
+        //Load the contents of the Section.xib file.
         Bundle.main.loadNibNamed("Section", owner: self, options: nil)
         self.addSubview(container)
         container.frame = self.bounds
     }
     
+    /**
+     Chancges the title of the section.
+     :param: title The new title.
+    */
     func setTitle(text: String){
         title.text = text
     }

+ 93 - 0
app/Sync.swift

@@ -0,0 +1,93 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import Foundation
+
+/**
+ Class to handle server sync.
+ */
+class Sync{
+    
+    /**
+     Starts the sync process.
+    */
+    init(){
+        let url = buildUrl();
+        sync(url: url)
+    
+    }
+    
+    /**
+     Builds the URL to perform the sync against.
+     :returns: The URL.
+    */
+    func buildUrl() -> URL{
+        let url = URL(string: "https://margolariak.com/API/v1/sync.php?client=com.margolariak.app")
+        //TODO add parameters
+        return url!
+        
+    }
+    
+    /**
+     Performs an asynchronous sync.
+     It fethes the info from the server and stores as Core Data
+     :param: url The url to sync.
+    */
+    func sync(url: URL){
+        
+        //Synchronously get data
+        let task = URLSession.shared.dataTask(with: url) { data, response, error in
+            guard error == nil else {
+                print("error")
+                return
+            }
+            guard let data = data else {
+                print("Data is empty")
+                return
+            }
+            
+            let json = try! JSONSerialization.jsonObject(with: data, options: [])
+            print(json)
+            
+            
+            //TODO: Do this for ech table
+            /*
+             let data = [
+             (1, ["name": "United States of America", "short_name": "US"]),
+             (2, ["name": "United Kingdom",           "short_name": "UK"]),
+             (3, ["name": "France"])]
+             
+             let companiesTable = db["companies"] // get the table from our SQLite Database
+             db.transaction(.Deferred) { txn in
+             for (index,company) in data {
+             if companiesTable.insert(name <- company["name"]!, shortname <- company["short_name"]).statement.failed {
+             return .Rollback
+             }
+             }
+             return .Commit
+             }
+             */
+        }
+        
+        task.resume()
+
+    }
+    
+}

+ 24 - 4
app/UIView.swift

@@ -1,14 +1,32 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  UIView.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Iñigo Valentin on 21/11/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import UIKit
 
+/**
+ Extension of UIView that adds some options at the interface
+ builder.
+ */
 @IBDesignable extension UIView {
+    
+    //Border color.
     @IBInspectable var borderColor:UIColor? {
         set {
             layer.borderColor = newValue!.cgColor
@@ -22,6 +40,8 @@ import UIKit
             }
         }
     }
+    
+    //Border width.
     @IBInspectable var borderWidth:CGFloat {
         set {
             layer.borderWidth = newValue

+ 30 - 7
app/ViewController.swift

@@ -1,23 +1,44 @@
+// Copyright (C) 2016 Inigo Valentin
 //
-//  ViewController.swift
-//  app
+// This file is part of the Gasteizko Margolariak IOS app.
 //
-//  Created by Inigo Valentin on 28/09/16.
-//  Copyright © 2016 Margolariak. All rights reserved.
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
 //
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
 
 import UIKit
 
+/**
+  The view controller of the app.
+ */
 class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
     
+    //The menu collection.
     var sectionCollection: UICollectionView!
 
+    //Each of the sections of the app.
     @IBOutlet weak var containerViewGallery: UIView!
     @IBOutlet weak var containerViewBlog: UIView!
     @IBOutlet weak var containerViewActivities: UIView!
     @IBOutlet weak var containerViewLablanca: UIView!
     @IBOutlet weak var containerViewLocation: UIView!
     @IBOutlet weak var containerViewHome: HomeView!
+    
+    /**
+     Run when the app loads.
+    */
     override func viewDidLoad() {
         
         //Hide all sections, except for the first one
@@ -31,11 +52,15 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
         // Do any additional setup after loading the view, typically from a nib.
     }
 
+    /**
+     Dispose of any resources that can be recreated.
+    */
     override func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
     }
     
+    
+    //Menu items.
     let reuseIdentifier = "cell"
     var selected = 0
     var items = ["Home", "Location", "La Blanca", "Actividades", "Blog", "Gallery"]
@@ -77,12 +102,10 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         sectionCollection = collectionView
-        print("You selected cell #\(indexPath.item)!")
         showComponent(selected: indexPath.item)
     }
     
     @IBAction func showComponent(selected: Int) {
-        print("SELECTED: \(selected)")
         //Activate label
         var i = 0
         for cell in sectionCollection.visibleCells as! [MenuCollectionViewCell]{ //TODO: Not only visibles!

+ 60 - 2
app/app.xcdatamodeld/app.xcdatamodel/contents

@@ -1,4 +1,62 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
-    <elements/>
+<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11542" systemVersion="16B2657" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
+    <entity name="Activity" representedClassName="Activity" syncable="YES" codeGenerationType="class">
+        <attribute name="after_en" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="after_es" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="after_eu" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="album" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="city" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="comments" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="inscription" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="max_people" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="permalink" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="price" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="text_en" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="text_es" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="text_eu" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="title_en" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="title_es" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="title_eu" optional="YES" attributeType="String" syncable="YES"/>
+    </entity>
+    <entity name="Activity_Comment" representedClassName="Activity_Comment" syncable="YES" codeGenerationType="class">
+        <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="dtime" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="lang" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="username" optional="YES" attributeType="String" syncable="YES"/>
+    </entity>
+    <entity name="Activity_Image" representedClassName="Activity_Image" syncable="YES" codeGenerationType="class">
+        <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="idx" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
+    </entity>
+    <entity name="Activity_Itinerary" representedClassName="Activity_Itinerary" syncable="YES" codeGenerationType="class">
+        <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="description_en" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="description_es" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="description_eu" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="end" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+        <attribute name="id" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="name_en" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="name_es" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="name_eu" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="place" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="start" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/>
+    </entity>
+    <entity name="Activity_Tag" representedClassName="Activity_Tag" syncable="YES" codeGenerationType="class">
+        <attribute name="activity" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
+        <attribute name="tag" optional="YES" attributeType="String" syncable="YES"/>
+    </entity>
+    <elements>
+        <element name="Activity" positionX="-56" positionY="-4059" width="128" height="328"/>
+        <element name="Activity_Comment" positionX="-45" positionY="-3906" width="128" height="135"/>
+        <element name="Activity_Image" positionX="-36" positionY="-3897" width="128" height="105"/>
+        <element name="Activity_Itinerary" positionX="-18" positionY="-3888" width="128" height="210"/>
+        <element name="Activity_Tag" positionX="0" positionY="-3852" width="128" height="75"/>
+    </elements>
 </model>

+ 4 - 0
app/db.xcdatamodeld/db.xcdatamodel/contents

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="11542" systemVersion="16B2657" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
+    <elements/>
+</model>