Skip to content

Commit

Permalink
Updated to Swift 1.2. Translated to English. Added new license GPL v3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Butron committed Apr 13, 2015
1 parent 98fa204 commit 15d0a22
Show file tree
Hide file tree
Showing 32 changed files with 201 additions and 66 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>1815F892-B709-400A-9EC0-5ED81C4961A1</string>
<key>IDESourceControlProjectName</key>
<string>CoreDataSample1</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</key>
<string>https://github.com/CarlosButron/Swift.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CoreDataSample1/CoreDataSample1.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/CarlosButron/Swift.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</string>
<key>IDESourceControlWCCName</key>
<string>Swift</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
10 changes: 9 additions & 1 deletion CoreDataSample1/CoreDataSample1/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
// CoreDataSample1
//
// Created by Carlos Butron on 02/12/14.
// Copyright (c) 2014 Carlos Butron. All rights reserved.
// Copyright (c) 2014 Carlos Butron.
//
// This program 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.
// This program 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 this program. If not, see
// http:/www.gnu.org/licenses/.
//

import UIKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6252" systemVersion="14B25" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Celda" syncable="YES">
<attribute name="imagen" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="subtitulo" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="titulo" optional="YES" attributeType="String" syncable="YES"/>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6252" systemVersion="14D131" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Cell" syncable="YES">
<attribute name="image" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="subtitle" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<elements>
<element name="Celda" positionX="-63" positionY="-18" width="128" height="90"/>
<element name="Cell" positionX="-63" positionY="-18" width="128" height="88"/>
</elements>
</model>
31 changes: 18 additions & 13 deletions CoreDataSample1/CoreDataSample1/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
// CoreDataSample1
//
// Created by Carlos Butron on 02/12/14.
// Copyright (c) 2014 Carlos Butron. All rights reserved.
// Copyright (c) 2014 Carlos Butron.
//
// This program 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.
// This program 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 this program. If not, see
// http:/www.gnu.org/licenses/.
//

import UIKit
Expand All @@ -22,21 +30,18 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega


//INSERT
// var appDel:AppDelegate = UIApplication.sharedApplication().delegate as
// AppDelegate
// var context:NSManagedObjectContext = appDel.managedObjectContext!
//
// var celda = NSEntityDescription.insertNewObjectForEntityForName("Celda", inManagedObjectContext: context) as NSManagedObject
// celda.setValue("Yoda Tux", forKey: "titulo")
// celda.setValue("Science Fiction", forKey: "subtitulo")
// celda.setValue("yodaTux.png", forKey: "imagen")

// var celda = NSEntityDescription.insertNewObjectForEntityForName("Cell", inManagedObjectContext: context) as NSManagedObject
// celda.setValue("Yoda Tux", forKey: "title")
// celda.setValue("Science Fiction", forKey: "subtitle")
// celda.setValue("yodaTux.png", forKey: "image")
// if(!context.save(nil)){
// println("Error!")
// }



var request = NSFetchRequest (entityName: "Celda")
var request = NSFetchRequest (entityName: "Cell")
request.returnsObjectsAsFaults = false

results = context.executeFetchRequest(request, error: nil)
Expand Down Expand Up @@ -65,9 +70,9 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega

var aux = results![indexPath.row] as NSManagedObject

cell.textLabel.text = aux.valueForKey("titulo") as? String
cell.detailTextLabel?.text = aux.valueForKey("subtitulo") as? String
cell.imageView.image = UIImage(named: aux.valueForKey("imagen") as String)
cell.textLabel.text = aux.valueForKey("title") as? String
cell.detailTextLabel?.text = aux.valueForKey("subtitle") as? String
cell.imageView.image = UIImage(named: aux.valueForKey("image") as String)

return cell
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>C1B09E25-EA2E-46A8-B402-7B2025C2FCBE</string>
<key>IDESourceControlProjectName</key>
<string>CoreDataSample2</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</key>
<string>https://github.com/CarlosButron/Swift.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CoreDataSample2/CoreDataSample2.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/CarlosButron/Swift.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>9FCBC930A8DBEE5E1E1094396CDFC4C7EE814530</string>
<key>IDESourceControlWCCName</key>
<string>Swift</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
10 changes: 9 additions & 1 deletion CoreDataSample2/CoreDataSample2/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
// CoreDataSample2
//
// Created by Carlos Butron on 02/12/14.
// Copyright (c) 2014 Carlos Butron. All rights reserved.
// Copyright (c) 2014 Carlos Butron.
//
// This program 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.
// This program 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 this program. If not, see
// http:/www.gnu.org/licenses/.
//

import UIKit
Expand Down
24 changes: 12 additions & 12 deletions CoreDataSample2/CoreDataSample2/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="4NF-Ow-axM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="4NF-Ow-axM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="0gb-cW-hxr">
<objects>
<viewController id="4NF-Ow-axM" customClass="ViewController" customModule="T15E3CarlosButron" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="4NF-Ow-axM" customClass="ViewController" customModule="CoreDataSample2" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="GF3-5K-4sK"/>
<viewControllerLayoutGuide type="bottom" id="uku-hZ-1tn"/>
Expand All @@ -16,14 +16,14 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Nombre" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7kD-fv-3AZ">
<rect key="frame" x="28" y="58" width="62" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7kD-fv-3AZ">
<rect key="frame" x="28" y="58" width="46" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Apellido" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cuZ-aN-wb9">
<rect key="frame" x="28" y="104" width="62" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Surname" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cuZ-aN-wb9">
<rect key="frame" x="28" y="104" width="70" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
Expand All @@ -34,12 +34,12 @@
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dHP-lg-blu">
<rect key="frame" x="130" y="153" width="56" height="30"/>
<state key="normal" title="Guardar">
<rect key="frame" x="130" y="153" width="34" height="30"/>
<state key="normal" title="Save">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="guardar:" destination="4NF-Ow-axM" eventType="touchUpInside" id="lmY-Df-15d"/>
<action selector="save:" destination="4NF-Ow-axM" eventType="touchUpInside" id="FAI-su-3G9"/>
</connections>
</button>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="oCm-ff-qwc">
Expand All @@ -59,9 +59,9 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="apellido" destination="Hh5-nI-wa0" id="pr5-sX-1KB"/>
<outlet property="nombre" destination="95X-Cn-sLZ" id="gsJ-b2-Psb"/>
<outlet property="tabla" destination="oCm-ff-qwc" id="hAk-Lr-O6f"/>
<outlet property="name" destination="95X-Cn-sLZ" id="MW9-2j-anR"/>
<outlet property="surname" destination="Hh5-nI-wa0" id="78A-00-Ycy"/>
<outlet property="table" destination="oCm-ff-qwc" id="PCS-0I-r6s"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="TV7-P7-rF7" sceneMemberID="firstResponder"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6252" systemVersion="14B25" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Formulario" syncable="YES">
<attribute name="apellido" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="nombre" optional="YES" attributeType="String" syncable="YES"/>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6252" systemVersion="14D131" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Form" syncable="YES">
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="surname" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<elements>
<element name="Formulario" positionX="-54" positionY="-9" width="128" height="75"/>
<element name="Form" positionX="-54" positionY="-9" width="128" height="75"/>
</elements>
</model>
Loading

0 comments on commit 15d0a22

Please sign in to comment.