First commit

This commit is contained in:
Ezequiel Alejandro Becerra
2013-01-05 20:33:16 -03:00
parent 056d11d51a
commit bf12b75d2d
46 changed files with 1785 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

View File

@@ -0,0 +1,460 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
6731CA541698DC660059EA97 /* MosaicData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6731CA451698DC660059EA97 /* MosaicData.m */; };
6731CA551698DC660059EA97 /* TwoDimentionalArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 6731CA481698DC660059EA97 /* TwoDimentionalArray.m */; };
6731CA561698DC660059EA97 /* MosaicDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6731CA4F1698DC660059EA97 /* MosaicDataView.m */; };
6731CA571698DC660059EA97 /* MosaicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6731CA511698DC660059EA97 /* MosaicView.m */; };
6731CA581698DC660059EA97 /* OverlayImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6731CA531698DC660059EA97 /* OverlayImageView.m */; };
6731CA6E1698E8C50059EA97 /* 001.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA671698E8C50059EA97 /* 001.jpg */; };
6731CA6F1698E8C50059EA97 /* 002.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA681698E8C50059EA97 /* 002.jpg */; };
6731CA701698E8C50059EA97 /* 003.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA691698E8C50059EA97 /* 003.jpg */; };
6731CA711698E8C50059EA97 /* 004.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA6A1698E8C50059EA97 /* 004.jpg */; };
6731CA731698E8C50059EA97 /* 006.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA6C1698E8C50059EA97 /* 006.jpg */; };
6731CA741698E8C50059EA97 /* 007.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA6D1698E8C50059EA97 /* 007.jpg */; };
6731CA781698EB2B0059EA97 /* 005.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA751698EB2B0059EA97 /* 005.jpg */; };
6731CA791698EB2B0059EA97 /* 008.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA761698EB2B0059EA97 /* 008.jpg */; };
6731CA7A1698EB2B0059EA97 /* 009.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 6731CA771698EB2B0059EA97 /* 009.jpg */; };
674171751634B6AF002A8B4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 674171741634B6AF002A8B4A /* UIKit.framework */; };
674171771634B6AF002A8B4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 674171761634B6AF002A8B4A /* Foundation.framework */; };
674171791634B6AF002A8B4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 674171781634B6AF002A8B4A /* CoreGraphics.framework */; };
6741717F1634B6AF002A8B4A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6741717D1634B6AF002A8B4A /* InfoPlist.strings */; };
674171811634B6AF002A8B4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 674171801634B6AF002A8B4A /* main.m */; };
674171851634B6AF002A8B4A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 674171841634B6AF002A8B4A /* AppDelegate.m */; };
674171871634B6AF002A8B4A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 674171861634B6AF002A8B4A /* Default.png */; };
674171891634B6AF002A8B4A /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 674171881634B6AF002A8B4A /* Default@2x.png */; };
6741718B1634B6AF002A8B4A /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6741718A1634B6AF002A8B4A /* Default-568h@2x.png */; };
67B49C3E1637399B005869DA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 67B49C391637399B005869DA /* ViewController.m */; };
67B49C42163739FA005869DA /* CustomMosaicDatasource.m in Sources */ = {isa = PBXBuildFile; fileRef = 67B49C41163739FA005869DA /* CustomMosaicDatasource.m */; };
67B49C4816373D47005869DA /* data.json in Resources */ = {isa = PBXBuildFile; fileRef = 67B49C4716373D47005869DA /* data.json */; };
67C20A21164BF9B3007A77F9 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 67C20A20164BF9B3007A77F9 /* Storyboard.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
6731CA441698DC660059EA97 /* MosaicData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicData.h; sourceTree = "<group>"; };
6731CA451698DC660059EA97 /* MosaicData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MosaicData.m; sourceTree = "<group>"; };
6731CA471698DC660059EA97 /* TwoDimentionalArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwoDimentionalArray.h; sourceTree = "<group>"; };
6731CA481698DC660059EA97 /* TwoDimentionalArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwoDimentionalArray.m; sourceTree = "<group>"; };
6731CA4A1698DC660059EA97 /* MosaicViewDatasourceProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicViewDatasourceProtocol.h; sourceTree = "<group>"; };
6731CA4B1698DC660059EA97 /* MosaicViewDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicViewDelegateProtocol.h; sourceTree = "<group>"; };
6731CA4E1698DC660059EA97 /* MosaicDataView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicDataView.h; sourceTree = "<group>"; };
6731CA4F1698DC660059EA97 /* MosaicDataView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MosaicDataView.m; sourceTree = "<group>"; };
6731CA501698DC660059EA97 /* MosaicView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicView.h; sourceTree = "<group>"; };
6731CA511698DC660059EA97 /* MosaicView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MosaicView.m; sourceTree = "<group>"; };
6731CA521698DC660059EA97 /* OverlayImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayImageView.h; sourceTree = "<group>"; };
6731CA531698DC660059EA97 /* OverlayImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverlayImageView.m; sourceTree = "<group>"; };
6731CA671698E8C50059EA97 /* 001.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 001.jpg; sourceTree = "<group>"; };
6731CA681698E8C50059EA97 /* 002.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 002.jpg; sourceTree = "<group>"; };
6731CA691698E8C50059EA97 /* 003.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 003.jpg; sourceTree = "<group>"; };
6731CA6A1698E8C50059EA97 /* 004.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 004.jpg; sourceTree = "<group>"; };
6731CA6C1698E8C50059EA97 /* 006.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 006.jpg; sourceTree = "<group>"; };
6731CA6D1698E8C50059EA97 /* 007.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 007.jpg; sourceTree = "<group>"; };
6731CA751698EB2B0059EA97 /* 005.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 005.jpg; sourceTree = "<group>"; };
6731CA761698EB2B0059EA97 /* 008.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 008.jpg; sourceTree = "<group>"; };
6731CA771698EB2B0059EA97 /* 009.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 009.jpg; sourceTree = "<group>"; };
674171701634B6AF002A8B4A /* MosaicUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MosaicUI.app; sourceTree = BUILT_PRODUCTS_DIR; };
674171741634B6AF002A8B4A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
674171761634B6AF002A8B4A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
674171781634B6AF002A8B4A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
6741717C1634B6AF002A8B4A /* MosaicUI-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MosaicUI-Info.plist"; sourceTree = "<group>"; };
6741717E1634B6AF002A8B4A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
674171801634B6AF002A8B4A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
674171821634B6AF002A8B4A /* MosaicUI-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MosaicUI-Prefix.pch"; sourceTree = "<group>"; };
674171831634B6AF002A8B4A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
674171841634B6AF002A8B4A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
674171861634B6AF002A8B4A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
674171881634B6AF002A8B4A /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
6741718A1634B6AF002A8B4A /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
67B49C381637399B005869DA /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
67B49C391637399B005869DA /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
67B49C40163739FA005869DA /* CustomMosaicDatasource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomMosaicDatasource.h; sourceTree = "<group>"; };
67B49C41163739FA005869DA /* CustomMosaicDatasource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomMosaicDatasource.m; sourceTree = "<group>"; };
67B49C4716373D47005869DA /* data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = data.json; path = MosaicUI/Resources/data.json; sourceTree = SOURCE_ROOT; };
67C20A20164BF9B3007A77F9 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6741716D1634B6AF002A8B4A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
674171751634B6AF002A8B4A /* UIKit.framework in Frameworks */,
674171771634B6AF002A8B4A /* Foundation.framework in Frameworks */,
674171791634B6AF002A8B4A /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6731CA421698DC660059EA97 /* MosaicUI */ = {
isa = PBXGroup;
children = (
6731CA431698DC660059EA97 /* Entities */,
6731CA461698DC660059EA97 /* Logic */,
6731CA491698DC660059EA97 /* Protocols */,
6731CA4D1698DC660059EA97 /* Views */,
);
path = MosaicUI;
sourceTree = "<group>";
};
6731CA431698DC660059EA97 /* Entities */ = {
isa = PBXGroup;
children = (
6731CA441698DC660059EA97 /* MosaicData.h */,
6731CA451698DC660059EA97 /* MosaicData.m */,
);
path = Entities;
sourceTree = "<group>";
};
6731CA461698DC660059EA97 /* Logic */ = {
isa = PBXGroup;
children = (
6731CA471698DC660059EA97 /* TwoDimentionalArray.h */,
6731CA481698DC660059EA97 /* TwoDimentionalArray.m */,
);
path = Logic;
sourceTree = "<group>";
};
6731CA491698DC660059EA97 /* Protocols */ = {
isa = PBXGroup;
children = (
6731CA4A1698DC660059EA97 /* MosaicViewDatasourceProtocol.h */,
6731CA4B1698DC660059EA97 /* MosaicViewDelegateProtocol.h */,
);
path = Protocols;
sourceTree = "<group>";
};
6731CA4D1698DC660059EA97 /* Views */ = {
isa = PBXGroup;
children = (
6731CA4E1698DC660059EA97 /* MosaicDataView.h */,
6731CA4F1698DC660059EA97 /* MosaicDataView.m */,
6731CA501698DC660059EA97 /* MosaicView.h */,
6731CA511698DC660059EA97 /* MosaicView.m */,
6731CA521698DC660059EA97 /* OverlayImageView.h */,
6731CA531698DC660059EA97 /* OverlayImageView.m */,
);
path = Views;
sourceTree = "<group>";
};
674171651634B6AF002A8B4A = {
isa = PBXGroup;
children = (
6741717A1634B6AF002A8B4A /* MosaicUI */,
674171731634B6AF002A8B4A /* Frameworks */,
674171711634B6AF002A8B4A /* Products */,
6741719A1634B910002A8B4A /* Resources */,
);
sourceTree = "<group>";
};
674171711634B6AF002A8B4A /* Products */ = {
isa = PBXGroup;
children = (
674171701634B6AF002A8B4A /* MosaicUI.app */,
);
name = Products;
sourceTree = "<group>";
};
674171731634B6AF002A8B4A /* Frameworks */ = {
isa = PBXGroup;
children = (
674171741634B6AF002A8B4A /* UIKit.framework */,
674171761634B6AF002A8B4A /* Foundation.framework */,
674171781634B6AF002A8B4A /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
6741717A1634B6AF002A8B4A /* MosaicUI */ = {
isa = PBXGroup;
children = (
67B49C321637399B005869DA /* Classes */,
67C20A20164BF9B3007A77F9 /* Storyboard.storyboard */,
674171831634B6AF002A8B4A /* AppDelegate.h */,
674171841634B6AF002A8B4A /* AppDelegate.m */,
6741717B1634B6AF002A8B4A /* Supporting Files */,
);
path = MosaicUI;
sourceTree = "<group>";
};
6741717B1634B6AF002A8B4A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6741717C1634B6AF002A8B4A /* MosaicUI-Info.plist */,
6741717D1634B6AF002A8B4A /* InfoPlist.strings */,
674171801634B6AF002A8B4A /* main.m */,
674171821634B6AF002A8B4A /* MosaicUI-Prefix.pch */,
674171861634B6AF002A8B4A /* Default.png */,
674171881634B6AF002A8B4A /* Default@2x.png */,
6741718A1634B6AF002A8B4A /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
6741719A1634B910002A8B4A /* Resources */ = {
isa = PBXGroup;
children = (
67B49C4716373D47005869DA /* data.json */,
6741719B1634B910002A8B4A /* Assets */,
);
name = Resources;
path = MosaicUI/Resources;
sourceTree = "<group>";
};
6741719B1634B910002A8B4A /* Assets */ = {
isa = PBXGroup;
children = (
6731CA751698EB2B0059EA97 /* 005.jpg */,
6731CA761698EB2B0059EA97 /* 008.jpg */,
6731CA771698EB2B0059EA97 /* 009.jpg */,
6731CA671698E8C50059EA97 /* 001.jpg */,
6731CA681698E8C50059EA97 /* 002.jpg */,
6731CA691698E8C50059EA97 /* 003.jpg */,
6731CA6A1698E8C50059EA97 /* 004.jpg */,
6731CA6C1698E8C50059EA97 /* 006.jpg */,
6731CA6D1698E8C50059EA97 /* 007.jpg */,
);
path = Assets;
sourceTree = "<group>";
};
67B49C321637399B005869DA /* Classes */ = {
isa = PBXGroup;
children = (
6731CA421698DC660059EA97 /* MosaicUI */,
67B49C361637399B005869DA /* Logic */,
67B49C371637399B005869DA /* ViewControllers */,
);
path = Classes;
sourceTree = "<group>";
};
67B49C361637399B005869DA /* Logic */ = {
isa = PBXGroup;
children = (
67B49C40163739FA005869DA /* CustomMosaicDatasource.h */,
67B49C41163739FA005869DA /* CustomMosaicDatasource.m */,
);
path = Logic;
sourceTree = "<group>";
};
67B49C371637399B005869DA /* ViewControllers */ = {
isa = PBXGroup;
children = (
67B49C381637399B005869DA /* ViewController.h */,
67B49C391637399B005869DA /* ViewController.m */,
);
path = ViewControllers;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6741716F1634B6AF002A8B4A /* MosaicUI */ = {
isa = PBXNativeTarget;
buildConfigurationList = 674171941634B6AF002A8B4A /* Build configuration list for PBXNativeTarget "MosaicUI" */;
buildPhases = (
6741716C1634B6AF002A8B4A /* Sources */,
6741716D1634B6AF002A8B4A /* Frameworks */,
6741716E1634B6AF002A8B4A /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MosaicUI;
productName = MosaicUI;
productReference = 674171701634B6AF002A8B4A /* MosaicUI.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
674171671634B6AF002A8B4A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = betzerra;
};
buildConfigurationList = 6741716A1634B6AF002A8B4A /* Build configuration list for PBXProject "MosaicUI" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 674171651634B6AF002A8B4A;
productRefGroup = 674171711634B6AF002A8B4A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6741716F1634B6AF002A8B4A /* MosaicUI */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6741716E1634B6AF002A8B4A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6741717F1634B6AF002A8B4A /* InfoPlist.strings in Resources */,
674171871634B6AF002A8B4A /* Default.png in Resources */,
674171891634B6AF002A8B4A /* Default@2x.png in Resources */,
6741718B1634B6AF002A8B4A /* Default-568h@2x.png in Resources */,
67B49C4816373D47005869DA /* data.json in Resources */,
67C20A21164BF9B3007A77F9 /* Storyboard.storyboard in Resources */,
6731CA6E1698E8C50059EA97 /* 001.jpg in Resources */,
6731CA6F1698E8C50059EA97 /* 002.jpg in Resources */,
6731CA701698E8C50059EA97 /* 003.jpg in Resources */,
6731CA711698E8C50059EA97 /* 004.jpg in Resources */,
6731CA731698E8C50059EA97 /* 006.jpg in Resources */,
6731CA741698E8C50059EA97 /* 007.jpg in Resources */,
6731CA781698EB2B0059EA97 /* 005.jpg in Resources */,
6731CA791698EB2B0059EA97 /* 008.jpg in Resources */,
6731CA7A1698EB2B0059EA97 /* 009.jpg in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6741716C1634B6AF002A8B4A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
674171811634B6AF002A8B4A /* main.m in Sources */,
674171851634B6AF002A8B4A /* AppDelegate.m in Sources */,
67B49C3E1637399B005869DA /* ViewController.m in Sources */,
67B49C42163739FA005869DA /* CustomMosaicDatasource.m in Sources */,
6731CA541698DC660059EA97 /* MosaicData.m in Sources */,
6731CA551698DC660059EA97 /* TwoDimentionalArray.m in Sources */,
6731CA561698DC660059EA97 /* MosaicDataView.m in Sources */,
6731CA571698DC660059EA97 /* MosaicView.m in Sources */,
6731CA581698DC660059EA97 /* OverlayImageView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
6741717D1634B6AF002A8B4A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6741717E1634B6AF002A8B4A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
674171921634B6AF002A8B4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
SDKROOT = iphoneos;
};
name = Debug;
};
674171931634B6AF002A8B4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
674171951634B6AF002A8B4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MosaicUI/MosaicUI-Prefix.pch";
INFOPLIST_FILE = "MosaicUI/MosaicUI-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
674171961634B6AF002A8B4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MosaicUI/MosaicUI-Prefix.pch";
INFOPLIST_FILE = "MosaicUI/MosaicUI-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6741716A1634B6AF002A8B4A /* Build configuration list for PBXProject "MosaicUI" */ = {
isa = XCConfigurationList;
buildConfigurations = (
674171921634B6AF002A8B4A /* Debug */,
674171931634B6AF002A8B4A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
674171941634B6AF002A8B4A /* Build configuration list for PBXNativeTarget "MosaicUI" */ = {
isa = XCConfigurationList;
buildConfigurations = (
674171951634B6AF002A8B4A /* Debug */,
674171961634B6AF002A8B4A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 674171671634B6AF002A8B4A /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MosaicUI.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,10 @@
<?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>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
<ExceptionBreakpoints>
<ExceptionBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</ExceptionBreakpoint>
</ExceptionBreakpoints>
</Bucket>

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6741716F1634B6AF002A8B4A"
BuildableName = "MosaicUI.app"
BlueprintName = "MosaicUI"
ReferencedContainer = "container:MosaicUI.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6741716F1634B6AF002A8B4A"
BuildableName = "MosaicUI.app"
BlueprintName = "MosaicUI"
ReferencedContainer = "container:MosaicUI.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6741716F1634B6AF002A8B4A"
BuildableName = "MosaicUI.app"
BlueprintName = "MosaicUI"
ReferencedContainer = "container:MosaicUI.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6741716F1634B6AF002A8B4A"
BuildableName = "MosaicUI.app"
BlueprintName = "MosaicUI"
ReferencedContainer = "container:MosaicUI.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?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>SchemeUserState</key>
<dict>
<key>MosaicUI.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>6741716F1634B6AF002A8B4A</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

15
MosaicUI/AppDelegate.h Normal file
View File

@@ -0,0 +1,15 @@
//
// AppDelegate.h
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

46
MosaicUI/AppDelegate.m Normal file
View File

@@ -0,0 +1,46 @@
//
// AppDelegate.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end

View File

@@ -0,0 +1,18 @@
//
// MosaicManager.h
// MosaicUI
//
// Created by Ezequiel Becerra on 10/23/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MosaicViewDatasourceProtocol.h"
@interface CustomMosaicDatasource : NSObject <MosaicViewDatasourceProtocol>{
NSMutableArray *elements;
}
+ (CustomMosaicDatasource *)sharedInstance;
@end

View File

@@ -0,0 +1,59 @@
//
// MosaicManager.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/23/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "CustomMosaicDatasource.h"
#import "MosaicData.h"
@implementation CustomMosaicDatasource
#pragma mark - Private
-(void)loadFromDisk{
NSString *pathString = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"json"];
NSData *elementsData = [NSData dataWithContentsOfFile:pathString];
NSError *anError = nil;
NSArray *parsedElements = [NSJSONSerialization JSONObjectWithData:elementsData
options:NSJSONReadingAllowFragments
error:&anError];
for (NSDictionary *aModuleDict in parsedElements){
MosaicData *aMosaicModule = [[MosaicData alloc] initWithDictionary:aModuleDict];
[elements addObject:aMosaicModule];
}
}
#pragma mark - Public
-(id)init{
self = [super init];
if (self){
elements = [[NSMutableArray alloc] init];
[self loadFromDisk];
}
return self;
}
// Singleton method proposed in WWDC 2012
+ (CustomMosaicDatasource *)sharedInstance {
static CustomMosaicDatasource *sharedInstance;
if (sharedInstance == nil)
sharedInstance = [CustomMosaicDatasource new];
return sharedInstance;
}
#pragma mark - MosaicViewDatasourceProtocol
-(NSArray *)mosaicElements{
NSArray *retVal = elements;
return retVal;
}
@end

View File

@@ -0,0 +1,24 @@
//
// MosaicModule.h
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MediaPlayer/MediaPlayer.h>
@interface MosaicData : NSObject{
NSString *imageFilename;
NSString *title;
NSInteger size;
}
-(id)initWithDictionary:(NSDictionary *)aDict;
@property (strong) NSString *imageFilename;
@property (strong) NSString *title;
@property (readwrite) NSInteger size;
@end

View File

@@ -0,0 +1,29 @@
//
// MosaicModule.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "MosaicData.h"
@implementation MosaicData
@synthesize imageFilename, title, size;
-(id)initWithDictionary:(NSDictionary *)aDict{
self = [self init];
if (self){
self.imageFilename = [aDict objectForKey:@"imageFilename"];
self.size = [[aDict objectForKey:@"size"] integerValue];
self.title = [aDict objectForKey:@"title"];
}
return self;
}
-(NSString *)description{
NSString *retVal = [NSString stringWithFormat:@"%@ %@", [super description], self.title];
return retVal;
}
@end

View File

@@ -0,0 +1,20 @@
//
// TwoDimentionalArray.h
// MosaicUI
//
// Created by Ezequiel A Becerra on 11/24/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface TwoDimentionalArray : NSObject{
NSMutableArray* elements;
NSUInteger rows, columns;
}
-(id)initWithColumns:(NSUInteger)numberOfColumns andRows:(NSUInteger)numberOfRows;
-(id)objectAtColumn:(NSUInteger)xIndex andRow:(NSUInteger)yIndex;
-(void)setObject:(id)anObject atColumn:(NSUInteger)xIndex andRow:(NSUInteger)yIndex;
@end

View File

@@ -0,0 +1,69 @@
//
// TwoDimentionalArray.m
// MosaicUI
//
// Created by Ezequiel A Becerra on 11/24/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "TwoDimentionalArray.h"
#define INVALID_ELEMENT_INDEX -1
@implementation TwoDimentionalArray
#pragma mark - Private
-(NSInteger)elementIndexWithColumn:(NSUInteger)xIndex andRow:(NSUInteger)yIndex{
NSInteger retVal = 0;
// Validating indexes are between columns / rows ranges
if (xIndex >= columns || yIndex >= rows){
retVal = INVALID_ELEMENT_INDEX;
}else{
retVal = xIndex + (yIndex * columns);
}
return retVal;
}
#pragma mark - Public
-(id)initWithColumns:(NSUInteger)numberOfColumns andRows:(NSUInteger)numberOfRows{
self = [super init];
if (self){
NSUInteger capacity = numberOfColumns * numberOfRows;
columns = numberOfColumns;
rows = numberOfRows;
elements = [[NSMutableArray alloc] initWithCapacity:capacity];
for(NSInteger i=0; i<capacity; i++){
[elements addObject:[NSNull null]];
}
}
return self;
}
-(id)objectAtColumn:(NSUInteger)xIndex andRow:(NSUInteger)yIndex{
id retVal = nil;
NSInteger elementIndex = [self elementIndexWithColumn:xIndex andRow:yIndex];
// If the index is not invalid (ie xIndex greater than column quantity) then...
if (elementIndex != INVALID_ELEMENT_INDEX){
// If the element in coord is not NULL then...
if ([elements objectAtIndex:elementIndex] != [NSNull null]){
retVal = [elements objectAtIndex:elementIndex];
}
}
return retVal;
}
-(void)setObject:(id)anObject atColumn:(NSUInteger)xIndex andRow:(NSUInteger)yIndex{
NSInteger elementIndex = [self elementIndexWithColumn:xIndex andRow:yIndex];
[elements replaceObjectAtIndex:elementIndex withObject:anObject];
}
@end

View File

@@ -0,0 +1,15 @@
//
// MosaicViewDatasourceProtocol.h
// MosaicUI
//
// Created by Ezequiel A Becerra on 12/9/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol MosaicViewDatasourceProtocol <NSObject>
-(NSArray *)mosaicElements;
@end

View File

@@ -0,0 +1,18 @@
//
// MosaicViewDelegateProtocol.h
// MosaicUI
//
// Created by Ezequiel A Becerra on 11/25/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MosaicDataView;
@protocol MosaicViewDelegateProtocol <NSObject>
-(void)mosaicViewDidTap:(MosaicDataView *)aModule;
-(void)mosaicViewDidDoubleTap:(MosaicDataView *)aModule;
@end

View File

@@ -0,0 +1,26 @@
//
// MosaicModuleView.h
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "MosaicData.h"
#import "MosaicViewDelegateProtocol.h"
@class MosaicView;
@interface MosaicDataView : UIView <UIGestureRecognizerDelegate>{
UIImageView *imageView;
UILabel *titleLabel;
MosaicData *module;
}
@property (strong) NSString *title;
@property (strong) MosaicData *module;
@property (weak) MosaicView *mosaicView;
@property (weak) id delegate;
@end

View File

@@ -0,0 +1,205 @@
//
// MosaicModuleView.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "MosaicDataView.h"
#import "MosaicView.h"
#define kMosaicDataViewDidTouchNotification @"kMosaicDataViewDidTouchNotification"
#define kMosaicDataViewFont @"Helvetica-Bold"
@implementation MosaicDataView
@synthesize delegate, mosaicView;
#pragma mark - Private
-(UIFont *)fontWithModuleSize:(NSUInteger)aSize{
UIFont *retVal = nil;
switch (aSize) {
case 0:
retVal = [UIFont fontWithName:kMosaicDataViewFont size:36];
break;
case 1:
retVal = [UIFont fontWithName:kMosaicDataViewFont size:18];
break;
case 2:
retVal = [UIFont fontWithName:kMosaicDataViewFont size:15];
break;
default:
retVal = [UIFont fontWithName:kMosaicDataViewFont size:15];
break;
}
return retVal;
}
-(void)mosaicViewDidTouch:(NSNotification *)aNotification{
MosaicDataView *aView = [aNotification.userInfo objectForKey:@"mosaicDataView"];
if (aView != self){
}
}
#pragma mark - Properties
-(NSString *)title{
NSString *retVal = titleLabel.text;
return retVal;
}
-(void)setTitle:(NSString *)title{
titleLabel.text = title;
}
-(void)setModule:(MosaicData *)newModule{
module = newModule;
UIImage *anImage = [UIImage imageNamed:self.module.imageFilename];
imageView.image = anImage;
float scale = 1;
if (anImage.size.width < anImage.size.height){
scale = anImage.size.width / anImage.size.height;
}else{
scale = anImage.size.height / anImage.size.width;
}
CGRect newFrame = imageView.frame;
newFrame.size.height /= scale;
newFrame.size.width /= scale;
imageView.frame = newFrame;
imageView.center = CGPointMake(self.frame.size.width/2, self.frame.size.height/2);
// Set new title
NSInteger marginLeft = self.frame.size.width / 20;
NSInteger marginBottom = self.frame.size.height / 20;
titleLabel.text = module.title;
titleLabel.font = [self fontWithModuleSize:module.size];
CGSize newSize = [module.title sizeWithFont:titleLabel.font constrainedToSize:titleLabel.frame.size];
CGRect newRect = CGRectMake(marginLeft,
self.frame.size.height - newSize.height - marginBottom,
newSize.width,
newSize.height);
titleLabel.frame = newRect;
}
-(MosaicData *)module{
return module;
}
-(void)displayHighlightAnimation{
if (self.mosaicView.selectedDataView != self){
// Notify to the rest of MosaicDataView to show the overlayView again
NSDictionary *aDict = @{@"mosaicDataView" : self};
[[NSNotificationCenter defaultCenter] postNotificationName:kMosaicDataViewDidTouchNotification
object:nil
userInfo:aDict];
self.alpha = 0.3;
[UIView animateWithDuration:0.5
delay:0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.alpha = 1;
}
completion:^(BOOL completed){
// Do nothing. This is only visual feedback.
// See simpleExclusiveTapRecognized instead
}];
}
}
-(void)simpleTapReceived:(id)sender{
if ([delegate respondsToSelector:@selector(mosaicViewDidTap:)]){
[delegate mosaicViewDidTap:self];
}
self.mosaicView.selectedDataView = self;
}
-(void)doubleTapReceived:(id)sender{
if ([delegate respondsToSelector:@selector(mosaicViewDidDoubleTap:)]){
[delegate mosaicViewDidDoubleTap:self];
}
}
#pragma mark - Public
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// UIImageView on background
CGRect imageViewFrame = CGRectMake(0,0,frame.size.width,frame.size.height);
imageView = [[UIImageView alloc] initWithFrame:imageViewFrame];
imageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:imageView];
// UILabel for title
CGRect titleLabelFrame = CGRectMake(0,
round(frame.size.height/2),
frame.size.width,
round(frame.size.height/2));
titleLabel = [[UILabel alloc] initWithFrame:titleLabelFrame];
titleLabel.textAlignment = NSTextAlignmentRight;
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont fontWithName:kMosaicDataViewFont size:15];
titleLabel.textColor = [UIColor whiteColor];
titleLabel.shadowColor = [UIColor blackColor];
titleLabel.shadowOffset = CGSizeMake(0, 1);
titleLabel.numberOfLines = 1;
[self addSubview:titleLabel];
// Set stroke width
self.layer.borderWidth = 1;
self.layer.borderColor = [UIColor blackColor].CGColor;
self.clipsToBounds = YES;
// Subscribe to a Notification so can unhighlight when user taps other MosaicDataViews
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mosaicViewDidTouch:)
name:kMosaicDataViewDidTouchNotification
object:nil];
// Add double tap recognizer
UITapGestureRecognizer *doubleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(doubleTapReceived:)];
doubleTapRecognizer.numberOfTapsRequired = 2;
[self addGestureRecognizer:doubleTapRecognizer];
// Add simple tap recognizer. This will get call ONLY if the double tap fails, so it's got a little delay
UITapGestureRecognizer *simpleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(simpleTapReceived:)];
simpleTapRecognizer.numberOfTapsRequired = 1;
[simpleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer];
simpleTapRecognizer.delegate = self;
[self addGestureRecognizer:simpleTapRecognizer];
}
return self;
}
-(void)removeFromSuperview{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super removeFromSuperview];
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
// Display the animation no matter if the gesture fails or not
BOOL retVal = [super gestureRecognizerShouldBegin:gestureRecognizer];
[self displayHighlightAnimation];
return retVal;
}
-(void)removeFromSuperview{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super removeFromSuperview];
}
@end

View File

@@ -0,0 +1,32 @@
//
// MosaivView.h
// MosaicUI
//
// Created by Ezequiel Becerra on 11/26/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "TwoDimentionalArray.h"
#import "MosaicViewDatasourceProtocol.h"
#import "MosaicViewDelegateProtocol.h"
#import "MosaicDataView.h"
@interface MosaicView : UIView{
TwoDimentionalArray *elements;
UIScrollView *scrollView;
NSInteger _maxElementsX;
NSInteger _maxElementsY;
BOOL isFirstLayoutTime;
}
@property (strong) id <MosaicViewDatasourceProtocol> datasource;
@property (strong) id <MosaicViewDelegateProtocol> delegate;
@property (strong) MosaicDataView *selectedDataView;
@end

View File

@@ -0,0 +1,258 @@
//
// MosaivView.m
// MosaicUI
//
// Created by Ezequiel Becerra on 11/26/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "MosaicView.h"
#import "MosaicData.h"
#import "MosaicDataView.h"
#define kModuleSizeInPoints_iPhone 80
#define kModuleSizeInPoints_iPad 128
#define kMaxScrollPages_iPhone 4
#define kMaxScrollPages_iPad 4
@implementation MosaicView
@synthesize datasource, delegate;
#pragma mark - Private
- (void)setup{
_maxElementsX = -1;
_maxElementsY = -1;
// Add scrollview and set its position and size using autolayout constraints
scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
scrollView.backgroundColor = [UIColor blackColor];
[self addSubview:scrollView];
isFirstLayoutTime = YES;
}
- (BOOL)doesModuleWithCGSize:(CGSize)aSize fitsInCoord:(CGPoint)aPoint{
BOOL retVal = YES;
NSInteger xOffset = 0;
NSInteger yOffset = 0;
while (retVal && yOffset < aSize.height){
xOffset = 0;
while (retVal && xOffset < aSize.width){
NSInteger xIndex = aPoint.x + xOffset;
NSInteger yIndex = aPoint.y + yOffset;
// Check if the coords are valid in the bidimensional array
if (xIndex < [self maxElementsX] && yIndex < [self maxElementsY]){
id anObject = [elements objectAtColumn:xIndex andRow:yIndex];
if (anObject != nil){
retVal = NO;
}
xOffset++;
}else{
retVal = NO;
}
}
yOffset++;
}
return retVal;
}
- (void)setModule:(MosaicData *)aModule withCGSize:(CGSize)aSize withCoord:(CGPoint)aPoint{
NSInteger xOffset = 0;
NSInteger yOffset = 0;
while (yOffset < aSize.height){
xOffset = 0;
while (xOffset < aSize.width){
NSInteger xIndex = aPoint.x + xOffset;
NSInteger yIndex = aPoint.y + yOffset;
[elements setObject:aModule atColumn:xIndex andRow:yIndex];
xOffset++;
}
yOffset++;
}
}
- (NSArray *)coordArrayForCGSize:(CGSize)aSize{
NSArray *retVal = nil;
BOOL hasFound = NO;
NSInteger i=0;
NSInteger j=0;
while (j < [self maxElementsY] && !hasFound){
i = 0;
while (i < [self maxElementsX] && !hasFound){
BOOL fitsInCoord = [self doesModuleWithCGSize:aSize fitsInCoord:CGPointMake(i, j)];
if (fitsInCoord){
hasFound = YES;
NSNumber *xIndex = [NSNumber numberWithInteger:i];
NSNumber *yIndex = [NSNumber numberWithInteger:j];
retVal = @[xIndex, yIndex];
}
i++;
}
j++;
}
return retVal;
}
- (CGSize)sizeForModuleSize:(NSUInteger)aSize{
CGSize retVal = CGSizeZero;
switch (aSize) {
case 0:
retVal = CGSizeMake(4, 4);
break;
case 1:
retVal = CGSizeMake(2, 2);
break;
case 2:
retVal = CGSizeMake(1, 1);
break;
default:
break;
}
return retVal;
}
- (NSInteger)moduleSizeInPoints{
NSInteger retVal = kModuleSizeInPoints_iPhone;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
retVal = kModuleSizeInPoints_iPad;
}
return retVal;
}
- (NSInteger)maxElementsX{
NSInteger retVal = _maxElementsX;
if (retVal == -1){
retVal = self.frame.size.width / [self moduleSizeInPoints];
}
return retVal;
}
- (NSInteger)maxElementsY{
NSInteger retVal = _maxElementsY;
if (retVal == -1){
retVal = self.frame.size.height / [self moduleSizeInPoints] * [self maxScrollPages];
}
return retVal;
}
- (NSInteger)maxScrollPages{
NSInteger retVal = kMaxScrollPages_iPhone;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
retVal = kMaxScrollPages_iPad;
}
return retVal;
}
- (void)setupLayoutWithMosaicElements:(NSArray *)mosaicElements{
NSInteger yOffset = 0;
_maxElementsX = -1;
_maxElementsY = -1;
NSInteger scrollHeight = 0;
scrollView.frame = [self bounds];
for (UIView *subView in scrollView.subviews){
[subView removeFromSuperview];
}
// Initial setup for the view
NSUInteger maxElementsX = [self maxElementsX];
NSUInteger maxElementsY = [self maxElementsY];
elements = [[TwoDimentionalArray alloc] initWithColumns:maxElementsX andRows:maxElementsY];
CGPoint modulePoint = CGPointZero;
MosaicDataView *lastModuleView = nil;
// Set modules in scrollView
for (MosaicData *aModule in mosaicElements){
CGSize aSize = [self sizeForModuleSize:aModule.size];
NSArray *coordArray = [self coordArrayForCGSize:aSize];
if (coordArray){
NSInteger xIndex = [coordArray[0] integerValue];
NSInteger yIndex = [coordArray[1] integerValue];
modulePoint = CGPointMake(xIndex, yIndex);
[self setModule:aModule withCGSize:aSize withCoord:modulePoint];
CGRect mosaicModuleRect = CGRectMake(xIndex * [self moduleSizeInPoints],
yIndex * [self moduleSizeInPoints] + yOffset,
aSize.width * [self moduleSizeInPoints],
aSize.height * [self moduleSizeInPoints]);
lastModuleView = [[MosaicDataView alloc] initWithFrame:mosaicModuleRect];
lastModuleView.module = aModule;
lastModuleView.delegate = self.delegate;
lastModuleView.mosaicView = self;
[scrollView addSubview:lastModuleView];
scrollHeight = MAX(scrollHeight, lastModuleView.frame.origin.y + lastModuleView.frame.size.height);
}
}
// Setup content size
CGSize contentSize = CGSizeMake(scrollView.frame.size.width,scrollHeight);
scrollView.contentSize = contentSize;
}
#pragma mark - Public
- (id)init{
self = [super init];
if (self){
[self setup];
}
return self;
}
- (void)awakeFromNib{
[super awakeFromNib];
[self setup];
}
- (void)layoutSubviews{
NSArray *mosaicElements = [self.datasource mosaicElements];
[self setupLayoutWithMosaicElements:mosaicElements];
[super layoutSubviews];
}
@end

View File

@@ -0,0 +1,18 @@
//
// OverlayImageView.h
// Mosaic
//
// Created by Ezequiel A Becerra on 12/10/12.
// Copyright (c) 2012 Betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OverlayImageView : UIView{
UIColor *overlayColor;
}
@property (strong) UIColor *overlayColor;
@property (strong) UIImage *image;
@end

View File

@@ -0,0 +1,64 @@
//
// OverlayImageView.m
// Mosaic
//
// Created by Ezequiel A Becerra on 12/10/12.
// Copyright (c) 2012 Betzerra. All rights reserved.
//
#import "OverlayImageView.h"
@implementation OverlayImageView
@synthesize image;
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self){
}
return self;
}
- (void)drawRect:(CGRect)rect{
CGContextRef context = UIGraphicsGetCurrentContext();
float scale = 1;
if (self.image.size.width < self.image.size.height){
scale = self.frame.size.width / self.image.size.width;
}else{
scale = self.frame.size.height / self.image.size.height;
}
CGSize imageScaledSize = CGSizeMake(self.image.size.width * scale, self.image.size.height * scale);
CGRect imageFrame = CGRectMake(self.frame.size.width/2 - imageScaledSize.width/2,
self.frame.size.height/2 - imageScaledSize.height/2,
imageScaledSize.width,
imageScaledSize.height);
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0f, imageFrame.size.height);
CGContextScaleCTM(context, 1.0f, -1.0f);
// Draw picture first
CGContextDrawImage(context, imageFrame, image.CGImage);
CGContextRestoreGState(context);
// Blend mode could be any of CGBlendMode values. Now draw filled rectangle
// over top of image.
CGContextSetBlendMode (context, kCGBlendModeMultiply);
CGContextSetFillColor(context, CGColorGetComponents(overlayColor.CGColor));
CGContextFillRect (context, self.bounds);
}
-(void)setOverlayColor:(UIColor *)newOverlayColor{
overlayColor = newOverlayColor;
}
-(UIColor *)overlayColor{
return overlayColor;
}
@end

View File

@@ -0,0 +1,17 @@
//
// ViewController.h
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MosaicView.h"
#import "MosaicViewDelegateProtocol.h"
@interface ViewController : UIViewController <MosaicViewDelegateProtocol>{
__weak IBOutlet MosaicView *mosaicView;
}
@end

View File

@@ -0,0 +1,42 @@
//
// ViewController.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import "ViewController.h"
#import "MosaicData.h"
#import "MosaicDataView.h"
#import "CustomMosaicDatasource.h"
@implementation ViewController
#pragma mark - Public
- (void)viewDidLayoutSubviews{
}
- (void)viewDidLoad{
[super viewDidLoad];
mosaicView.datasource = [CustomMosaicDatasource sharedInstance];
mosaicView.delegate = self;
}
- (void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - MosaicViewDelegateProtocol
-(void)mosaicViewDidTap:(MosaicDataView *)aModule{
NSLog(@"#DEBUG Tapped %@", aModule.module);
}
-(void)mosaicViewDidDoubleTap:(MosaicDataView *)aModule{
NSLog(@"#DEBUG Double Tapped %@", aModule.module);
}
@end

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
MosaicUI/Default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
MosaicUI/Default@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,49 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>ar.com.betzerra.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'MosaicUI' target in the 'MosaicUI' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

View File

@@ -0,0 +1,47 @@
[
{
"imageFilename": "001.jpg",
"size": 1,
"title": "Seagud"
},
{
"imageFilename": "002.jpg",
"size": 0,
"title": "What now?"
},
{
"imageFilename": "003.jpg",
"size": 2,
"title": ""
},
{
"imageFilename": "004.jpg",
"size": 1,
"title": "Hope"
},
{
"imageFilename": "006.jpg",
"size": 1,
"title": "Graffiti"
},
{
"imageFilename": "007.jpg",
"size": 1,
"title": "New T-Shirt"
},
{
"imageFilename": "005.jpg",
"size": 2,
"title": ""
},
{
"imageFilename": "008.jpg",
"size": 2,
"title": ""
},
{
"imageFilename": "009.jpg",
"size": 2,
"title": ""
}
]

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2844" systemVersion="12C3006" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="aWe-Nn-K9C">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1930"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="AWf-D5-6G5">
<objects>
<viewController id="aWe-Nn-K9C" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="usO-TA-rc5">
<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="iPL-w0-xSi" customClass="MosaicView">
<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
<nil key="simulatedStatusBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="mosaicView" destination="iPL-w0-xSi" id="Uy5-o2-xiE"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Bxc-NS-6cz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-88" y="-424"/>
</scene>
</scenes>
<classes>
<class className="MosaicView" superclassName="UIView">
<source key="sourceIdentifier" type="project" relativePath="./Classes/MosaicView.h"/>
</class>
<class className="ViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
<relationships>
<relationship kind="outlet" name="mosaicView" candidateClass="MosaicView"/>
</relationships>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2840" systemVersion="12C54" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1926"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-3" y="-29"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

18
MosaicUI/main.m Normal file
View File

@@ -0,0 +1,18 @@
//
// main.m
// MosaicUI
//
// Created by Ezequiel Becerra on 10/21/12.
// Copyright (c) 2012 betzerra. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@@ -1,4 +1,2 @@
MosaicUI
========
A tiled UI for iOS and iPhone
========