├── DotMatrixDemo1.gif
├── dotmatrix_example.png
├── CKDotMatrixView_Storyboard1.png
├── CKDotMatrixView_Storyboard2.png
├── DotMatrixDemo
├── Podfile
├── DotMatrixDemo.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
├── DotMatrixDemo
│ ├── AppDelegate.h
│ ├── main.m
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── AppDelegate.m
│ └── Base.lproj
│ │ ├── LaunchScreen.xib
│ │ └── Main.storyboard
└── DotMatrixDemoTests
│ ├── Info.plist
│ └── DotMatrixDemoTests.m
├── CKDotMatrixView
├── CKDotMatrixFontMapping.h
├── CKDotMatrixView.h
├── CKDotMatrixView.m
└── CKDotMatrixFontMapping.m
├── .gitignore
├── CKDotMatrixView.podspec
├── LICENSE
└── README.md
/DotMatrixDemo1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaNd3r/CKDotMatrixView/HEAD/DotMatrixDemo1.gif
--------------------------------------------------------------------------------
/dotmatrix_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaNd3r/CKDotMatrixView/HEAD/dotmatrix_example.png
--------------------------------------------------------------------------------
/CKDotMatrixView_Storyboard1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaNd3r/CKDotMatrixView/HEAD/CKDotMatrixView_Storyboard1.png
--------------------------------------------------------------------------------
/CKDotMatrixView_Storyboard2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaNd3r/CKDotMatrixView/HEAD/CKDotMatrixView_Storyboard2.png
--------------------------------------------------------------------------------
/DotMatrixDemo/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '8.1'
2 |
3 | use_frameworks!
4 |
5 | pod 'CKDotMatrixView', :path => "../CKDotMatrixView.podspec"
6 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CKDotMatrixView/CKDotMatrixFontMapping.h:
--------------------------------------------------------------------------------
1 | //
2 | // CKDotMatrixFontMapping.h
3 | // CKDotMatrixView
4 | //
5 | // Created by Christian Klaproth on 02.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CKDotMatrixFontMapping : NSObject
12 |
13 | @property (nonatomic) NSDictionary* defaultMapping;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // DotMatrixDemo
4 | //
5 | // Created by Christian Klaproth on 08.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // DotMatrixDemo
4 | //
5 | // Created by Christian Klaproth on 08.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CKDotMatrixView/CKDotMatrixView.h:
--------------------------------------------------------------------------------
1 | //
2 | // CKDotMatrixView.h
3 | // CKDotMatrixView
4 | //
5 | // Created by Christian Klaproth on 02.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CKDotMatrixFontMapping.h"
11 |
12 | IB_DESIGNABLE
13 |
14 | @interface CKDotMatrixView : UIView
15 |
16 | @property (nonatomic) IBInspectable NSUInteger horizontalDotCount;
17 | @property (nonatomic) IBInspectable NSUInteger verticalDotCount;
18 | @property (nonatomic) CKDotMatrixFontMapping* fontMapping;
19 | @property (nonatomic) IBInspectable NSString* text;
20 | @property (nonatomic) IBInspectable BOOL animated;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | DotMatrixDemo/DotMatrixDemo.xcodeproj/project.xcworkspace/xcuserdata/klaproth.xcuserdatad/UserInterfaceState.xcuserstate
3 |
4 | DotMatrixDemo/DotMatrixDemo.xcodeproj/xcuserdata/klaproth.xcuserdatad/xcschemes/DotMatrixDemo.xcscheme
5 |
6 | DotMatrixDemo/DotMatrixDemo.xcodeproj/xcuserdata/klaproth.xcuserdatad/xcschemes/xcschememanagement.plist
7 |
8 | DotMatrixDemo/DotMatrixDemo.xcodeproj/project.xcworkspace/xcshareddata/DotMatrixDemo.xccheckout
9 |
10 | DotMatrixDemo/DotMatrixDemo.xcworkspace/xcshareddata/DotMatrixDemo.xccheckout
11 |
12 | DotMatrixDemo/DotMatrixDemo.xcworkspace/xcuserdata/klaproth.xcuserdatad/UserInterfaceState.xcuserstate
13 |
14 | DotMatrixDemo/Pods/*
15 |
16 | DotMatrixDemo/Podfile.lock
17 |
18 | DotMatrixDemo/DotMatrixDemo.xcworkspace/contents.xcworkspacedata
19 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | de.gebit.ios.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemoTests/DotMatrixDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // DotMatrixDemoTests.m
3 | // DotMatrixDemoTests
4 | //
5 | // Created by Christian Klaproth on 08.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface DotMatrixDemoTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation DotMatrixDemoTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/CKDotMatrixView.podspec:
--------------------------------------------------------------------------------
1 |
2 | Pod::Spec.new do |s|
3 |
4 | s.name = "CKDotMatrixView"
5 | s.version = "0.1.2"
6 | s.summary = "A highly customizable animated banner-like dot matrix view."
7 |
8 | s.description = <<-DESC
9 | CKDotMatrixView provides a retro-style dot matrix that displays
10 | numbers or text. It is completely configured via storyboard. Use
11 | it just like you would place text on a label programmatically.
12 | DESC
13 |
14 | s.homepage = "https://github.com/JaNd3r/CKDotMatrixView"
15 | s.screenshots = "https://raw.githubusercontent.com/JaNd3r/CKDotMatrixView/master/DotMatrixDemo1.gif"
16 |
17 | s.license = { :type => "MIT", :file => "LICENSE" }
18 | s.author = { "Christian Klaproth" => "ck@cm-works.de" }
19 | s.social_media_url = "http://twitter.com/JaNd3r"
20 |
21 | s.platform = :ios, "8.1"
22 | s.requires_arc = true
23 |
24 | s.source = { :git => "https://github.com/JaNd3r/CKDotMatrixView.git", :tag => "0.1.2" }
25 |
26 | s.source_files = "CKDotMatrixView/*.{h,m}"
27 |
28 | end
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Christian Klaproth
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | de.gebit.ios.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // DotMatrixDemo
4 | //
5 | // Created by Christian Klaproth on 08.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // 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.
25 | // 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.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // 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.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // 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.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // 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.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CKDotMatrixView
2 | ===============
3 |
4 | [](http://cocoadocs.org/docsets/CKDotMatrixView)
5 | [](http://cocoadocs.org/docsets/CKDotMatrixView)
6 |
7 | Looking for a highly customizable animated banner-like dot matrix view? Got it!
8 |
9 | 
10 |
11 | It's almost as easy to handle as a `UILabel`.
12 |
13 | To see the demo app in action, clone this repo, navigate to the `DotMatrixDemo` folder and run `pod install`. Open the created workspace in Xcode and you are ready to go.
14 |
15 | Here's a screenshot of a real app that uses two `CKDotMatrixView` instances to simulate a retro till display.
16 |
17 | 
18 |
19 | ## Features
20 |
21 | * Can be adjusted to fit almost any size using storyboard settings only (including live rendering!).
22 | * Uses color information provided in the storyboard.
23 | * Provides some basic animation (to be optimized and extended...)
24 | * Displays a cool glowing around the illuminated dots.
25 | * Comes with a 10 dot font providing numbers and upper case fonts (to be extended...)
26 |
27 | ## Usage
28 |
29 | As you can see in the provided demo app, the `CKDotMatrixView` can be added to your app's UI without a single line of code (there's no view controller implementation in that demo app).
30 |
31 | Add a `UIView` to your storyboard and set its origin and size appropriately.
32 |
33 | Head to the _identity inspector_ and set the class to `CKDotMatrixView`. You don't have to add the _user defined runtime attributes_ by yourself (since 0.1.1).
34 |
35 | 
36 |
37 | Go to the _attributes inspector_ and set the following properties in the first section titled _Dot Matrix View_:
38 | * `horizontalDotCount` - number of dots displayed horizontally (mandatory)
39 | * `verticalDotCount` - number of dots displayed vertically (mandatory)
40 | * `text` - the string to be displayed by the dot matrix (optional, can be used for static content)
41 | * `animated` - a flag indicating, wether the content should be initially animated (optional, default is `NO`). Please note, that the interface builder's live rendering will be always without animation.
42 |
43 | Finally set the background color and the tint color as you like. The illuminated dots will be drawn using the tint color and the dots that are off will be drawn using a slightly lighter color than the background color.
44 |
45 | 
46 |
47 | If you want to set the text programmatically simply set the `text` property of the `CKDotMatrixView` instance.
48 |
49 | You can create your own dot font by providing your own `CKDotMatrixFontMapping` and setting it to the `fontMapping` property of the `CKDotMatrixView` instance.
50 |
51 | ## Author
52 |
53 | Christian Klaproth, [@JaNd3r](http://twitter.com/JaNd3r)
54 |
55 | ## Thanks to...
56 |
57 | ... [@ivowessel](http://twitter.com/ivowessel) for pointing me at the interface builder's live rendering feature.
58 |
59 | ## License
60 |
61 | `CKDotMatrixView` is available under the MIT license. See the LICENSE file for more info.
62 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DotMatrixDemo/DotMatrixDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/CKDotMatrixView/CKDotMatrixView.m:
--------------------------------------------------------------------------------
1 | //
2 | // CKDotMatrixView.m
3 | // CKDotMatrixView
4 | //
5 | // Created by Christian Klaproth on 02.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import "CKDotMatrixView.h"
10 |
11 | @interface CKDotMatrixView()
12 |
13 | @property (nonatomic) BOOL horizontalDotCountSpecified;
14 | @property (nonatomic) BOOL verticalDotCountSpecified;
15 | @property (nonatomic) BOOL matrixInitialized;
16 | @property (nonatomic) UIColor* dotOffColor;
17 | @property (nonatomic) UIColor* dotGlowColor;
18 | @property (nonatomic) NSMutableDictionary* textMatrix;
19 |
20 | @property (nonatomic) NSUInteger animationOffset;
21 | @property (nonatomic) NSUInteger animationStep;
22 | @property (nonatomic) CGFloat animationDelay;
23 |
24 | @end
25 |
26 | @implementation CKDotMatrixView
27 |
28 | - (instancetype)init
29 | {
30 | self = [super init];
31 | if (self) {
32 | [self internalInitialize];
33 | }
34 | return self;
35 | }
36 |
37 | - (instancetype)initWithCoder:(NSCoder *)aDecoder
38 | {
39 | self = [super initWithCoder:aDecoder];
40 | if (self) {
41 | [self internalInitialize];
42 | }
43 | return self;
44 | }
45 |
46 | - (void)prepareForInterfaceBuilder
47 | {
48 | [super prepareForInterfaceBuilder];
49 | [self internalInitialize];
50 | if (self.text) {
51 | [self internalShowText];
52 | }
53 | }
54 |
55 | - (void)internalInitialize
56 | {
57 | self.fontMapping = [CKDotMatrixFontMapping new];
58 | self.textMatrix = [NSMutableDictionary new];
59 | self.opaque = YES;
60 | self.horizontalDotCountSpecified = NO;
61 | self.verticalDotCountSpecified = NO;
62 | self.matrixInitialized = NO;
63 | CGFloat tRed = 0.0;
64 | CGFloat tGreen = 0.0;
65 | CGFloat tBlue = 0.0;
66 | CGFloat tAlpha = 0.0;
67 | [self.backgroundColor getRed:&tRed green:&tGreen blue:&tBlue alpha:&tAlpha];
68 | self.dotOffColor = [[UIColor alloc] initWithRed:tRed+0.12 green:tGreen+0.12 blue:tBlue+0.12 alpha:tAlpha];
69 |
70 | [self.tintColor getRed:&tRed green:&tGreen blue:&tBlue alpha:&tAlpha];
71 | self.dotGlowColor = [[UIColor alloc] initWithRed:MAX(tRed+0.05, 1.0) green:MAX(tGreen+0.05, 1.0) blue:MAX(tBlue+0.05, 1.0) alpha:0.90];
72 |
73 | self.animationStep = 2;
74 | self.animationDelay = 0.05;
75 | self.animationOffset = 0;
76 | }
77 |
78 | - (void)setHorizontalDotCount:(NSUInteger)horizontalDotCount
79 | {
80 | _horizontalDotCount = horizontalDotCount;
81 | self.horizontalDotCountSpecified = YES;
82 | }
83 |
84 | - (void)setVerticalDotCount:(NSUInteger)verticalDotCount
85 | {
86 | _verticalDotCount = verticalDotCount;
87 | self.verticalDotCountSpecified = YES;
88 | }
89 |
90 | - (void)layoutSubviews
91 | {
92 | [super layoutSubviews];
93 |
94 | if (self.horizontalDotCountSpecified && self.verticalDotCountSpecified) {
95 | [self initializeMatrix];
96 | }
97 | }
98 |
99 | - (void)initializeMatrix
100 | {
101 | for (int y=0; y 0) {
162 | if (self.animationStep > self.animationOffset) {
163 | self.animationOffset = 0;
164 | } else {
165 | self.animationOffset = self.animationOffset - self.animationStep;
166 | }
167 | [self performSelector:@selector(setNeedsDisplay) withObject:nil afterDelay:self.animationDelay];
168 | }
169 | }
170 |
171 | - (void)setText:(NSString *)text
172 | {
173 | _text = text;
174 | if (self.matrixInitialized) {
175 | [self internalShowText];
176 | }
177 | }
178 |
179 | - (void)internalShowText
180 | {
181 | #if !TARGET_INTERFACE_BUILDER
182 | if (self.animated) {
183 | self.animationOffset = self.horizontalDotCount;
184 | }
185 | #endif
186 |
187 | int tCurrentPosition = 0;
188 | int tCurrentWidth = 0;
189 | for (int i=0; i /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
268 | showEnvVarsInLog = 0;
269 | };
270 | 735E32E5E4BE1639A7174216 /* Copy Pods Resources */ = {
271 | isa = PBXShellScriptBuildPhase;
272 | buildActionMask = 2147483647;
273 | files = (
274 | );
275 | inputPaths = (
276 | );
277 | name = "Copy Pods Resources";
278 | outputPaths = (
279 | );
280 | runOnlyForDeploymentPostprocessing = 0;
281 | shellPath = /bin/sh;
282 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
283 | showEnvVarsInLog = 0;
284 | };
285 | /* End PBXShellScriptBuildPhase section */
286 |
287 | /* Begin PBXSourcesBuildPhase section */
288 | 1DFB8A6F1A35DF7C00D98009 /* Sources */ = {
289 | isa = PBXSourcesBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | 1DFB8A7C1A35DF7C00D98009 /* AppDelegate.m in Sources */,
293 | 1DFB8A791A35DF7C00D98009 /* main.m in Sources */,
294 | );
295 | runOnlyForDeploymentPostprocessing = 0;
296 | };
297 | 1DFB8A881A35DF7C00D98009 /* Sources */ = {
298 | isa = PBXSourcesBuildPhase;
299 | buildActionMask = 2147483647;
300 | files = (
301 | 1DFB8A931A35DF7C00D98009 /* DotMatrixDemoTests.m in Sources */,
302 | );
303 | runOnlyForDeploymentPostprocessing = 0;
304 | };
305 | /* End PBXSourcesBuildPhase section */
306 |
307 | /* Begin PBXTargetDependency section */
308 | 1DFB8A8E1A35DF7C00D98009 /* PBXTargetDependency */ = {
309 | isa = PBXTargetDependency;
310 | target = 1DFB8A721A35DF7C00D98009 /* DotMatrixDemo */;
311 | targetProxy = 1DFB8A8D1A35DF7C00D98009 /* PBXContainerItemProxy */;
312 | };
313 | /* End PBXTargetDependency section */
314 |
315 | /* Begin PBXVariantGroup section */
316 | 1DFB8A801A35DF7C00D98009 /* Main.storyboard */ = {
317 | isa = PBXVariantGroup;
318 | children = (
319 | 1DFB8A811A35DF7C00D98009 /* Base */,
320 | );
321 | name = Main.storyboard;
322 | sourceTree = "";
323 | };
324 | 1DFB8A851A35DF7C00D98009 /* LaunchScreen.xib */ = {
325 | isa = PBXVariantGroup;
326 | children = (
327 | 1DFB8A861A35DF7C00D98009 /* Base */,
328 | );
329 | name = LaunchScreen.xib;
330 | sourceTree = "";
331 | };
332 | /* End PBXVariantGroup section */
333 |
334 | /* Begin XCBuildConfiguration section */
335 | 1DFB8A941A35DF7C00D98009 /* Debug */ = {
336 | isa = XCBuildConfiguration;
337 | buildSettings = {
338 | ALWAYS_SEARCH_USER_PATHS = NO;
339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
340 | CLANG_CXX_LIBRARY = "libc++";
341 | CLANG_ENABLE_MODULES = YES;
342 | CLANG_ENABLE_OBJC_ARC = YES;
343 | CLANG_WARN_BOOL_CONVERSION = YES;
344 | CLANG_WARN_CONSTANT_CONVERSION = YES;
345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
346 | CLANG_WARN_EMPTY_BODY = YES;
347 | CLANG_WARN_ENUM_CONVERSION = YES;
348 | CLANG_WARN_INT_CONVERSION = YES;
349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
350 | CLANG_WARN_UNREACHABLE_CODE = YES;
351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
353 | COPY_PHASE_STRIP = NO;
354 | ENABLE_STRICT_OBJC_MSGSEND = YES;
355 | GCC_C_LANGUAGE_STANDARD = gnu99;
356 | GCC_DYNAMIC_NO_PIC = NO;
357 | GCC_OPTIMIZATION_LEVEL = 0;
358 | GCC_PREPROCESSOR_DEFINITIONS = (
359 | "DEBUG=1",
360 | "$(inherited)",
361 | );
362 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
365 | GCC_WARN_UNDECLARED_SELECTOR = YES;
366 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
367 | GCC_WARN_UNUSED_FUNCTION = YES;
368 | GCC_WARN_UNUSED_VARIABLE = YES;
369 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
370 | MTL_ENABLE_DEBUG_INFO = YES;
371 | ONLY_ACTIVE_ARCH = YES;
372 | SDKROOT = iphoneos;
373 | };
374 | name = Debug;
375 | };
376 | 1DFB8A951A35DF7C00D98009 /* Release */ = {
377 | isa = XCBuildConfiguration;
378 | buildSettings = {
379 | ALWAYS_SEARCH_USER_PATHS = NO;
380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
381 | CLANG_CXX_LIBRARY = "libc++";
382 | CLANG_ENABLE_MODULES = YES;
383 | CLANG_ENABLE_OBJC_ARC = YES;
384 | CLANG_WARN_BOOL_CONVERSION = YES;
385 | CLANG_WARN_CONSTANT_CONVERSION = YES;
386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
387 | CLANG_WARN_EMPTY_BODY = YES;
388 | CLANG_WARN_ENUM_CONVERSION = YES;
389 | CLANG_WARN_INT_CONVERSION = YES;
390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
391 | CLANG_WARN_UNREACHABLE_CODE = YES;
392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
394 | COPY_PHASE_STRIP = YES;
395 | ENABLE_NS_ASSERTIONS = NO;
396 | ENABLE_STRICT_OBJC_MSGSEND = YES;
397 | GCC_C_LANGUAGE_STANDARD = gnu99;
398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
400 | GCC_WARN_UNDECLARED_SELECTOR = YES;
401 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
402 | GCC_WARN_UNUSED_FUNCTION = YES;
403 | GCC_WARN_UNUSED_VARIABLE = YES;
404 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
405 | MTL_ENABLE_DEBUG_INFO = NO;
406 | SDKROOT = iphoneos;
407 | VALIDATE_PRODUCT = YES;
408 | };
409 | name = Release;
410 | };
411 | 1DFB8A971A35DF7C00D98009 /* Debug */ = {
412 | isa = XCBuildConfiguration;
413 | baseConfigurationReference = 55A3DD39E4BBDF4989E35E0D /* Pods.debug.xcconfig */;
414 | buildSettings = {
415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
416 | INFOPLIST_FILE = DotMatrixDemo/Info.plist;
417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
418 | PRODUCT_NAME = "$(TARGET_NAME)";
419 | };
420 | name = Debug;
421 | };
422 | 1DFB8A981A35DF7C00D98009 /* Release */ = {
423 | isa = XCBuildConfiguration;
424 | baseConfigurationReference = FF3C4C7E4F6A9E181D8CA4C8 /* Pods.release.xcconfig */;
425 | buildSettings = {
426 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
427 | INFOPLIST_FILE = DotMatrixDemo/Info.plist;
428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
429 | PRODUCT_NAME = "$(TARGET_NAME)";
430 | };
431 | name = Release;
432 | };
433 | 1DFB8A9A1A35DF7C00D98009 /* Debug */ = {
434 | isa = XCBuildConfiguration;
435 | buildSettings = {
436 | BUNDLE_LOADER = "$(TEST_HOST)";
437 | FRAMEWORK_SEARCH_PATHS = (
438 | "$(SDKROOT)/Developer/Library/Frameworks",
439 | "$(inherited)",
440 | );
441 | GCC_PREPROCESSOR_DEFINITIONS = (
442 | "DEBUG=1",
443 | "$(inherited)",
444 | );
445 | INFOPLIST_FILE = DotMatrixDemoTests/Info.plist;
446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
447 | PRODUCT_NAME = "$(TARGET_NAME)";
448 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DotMatrixDemo.app/DotMatrixDemo";
449 | };
450 | name = Debug;
451 | };
452 | 1DFB8A9B1A35DF7C00D98009 /* Release */ = {
453 | isa = XCBuildConfiguration;
454 | buildSettings = {
455 | BUNDLE_LOADER = "$(TEST_HOST)";
456 | FRAMEWORK_SEARCH_PATHS = (
457 | "$(SDKROOT)/Developer/Library/Frameworks",
458 | "$(inherited)",
459 | );
460 | INFOPLIST_FILE = DotMatrixDemoTests/Info.plist;
461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
462 | PRODUCT_NAME = "$(TARGET_NAME)";
463 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DotMatrixDemo.app/DotMatrixDemo";
464 | };
465 | name = Release;
466 | };
467 | /* End XCBuildConfiguration section */
468 |
469 | /* Begin XCConfigurationList section */
470 | 1DFB8A6E1A35DF7C00D98009 /* Build configuration list for PBXProject "DotMatrixDemo" */ = {
471 | isa = XCConfigurationList;
472 | buildConfigurations = (
473 | 1DFB8A941A35DF7C00D98009 /* Debug */,
474 | 1DFB8A951A35DF7C00D98009 /* Release */,
475 | );
476 | defaultConfigurationIsVisible = 0;
477 | defaultConfigurationName = Release;
478 | };
479 | 1DFB8A961A35DF7C00D98009 /* Build configuration list for PBXNativeTarget "DotMatrixDemo" */ = {
480 | isa = XCConfigurationList;
481 | buildConfigurations = (
482 | 1DFB8A971A35DF7C00D98009 /* Debug */,
483 | 1DFB8A981A35DF7C00D98009 /* Release */,
484 | );
485 | defaultConfigurationIsVisible = 0;
486 | defaultConfigurationName = Release;
487 | };
488 | 1DFB8A991A35DF7C00D98009 /* Build configuration list for PBXNativeTarget "DotMatrixDemoTests" */ = {
489 | isa = XCConfigurationList;
490 | buildConfigurations = (
491 | 1DFB8A9A1A35DF7C00D98009 /* Debug */,
492 | 1DFB8A9B1A35DF7C00D98009 /* Release */,
493 | );
494 | defaultConfigurationIsVisible = 0;
495 | defaultConfigurationName = Release;
496 | };
497 | /* End XCConfigurationList section */
498 | };
499 | rootObject = 1DFB8A6B1A35DF7C00D98009 /* Project object */;
500 | }
501 |
--------------------------------------------------------------------------------
/CKDotMatrixView/CKDotMatrixFontMapping.m:
--------------------------------------------------------------------------------
1 | //
2 | // CKDotMatrixFontMapping.m
3 | // CKDotMatrixView
4 | //
5 | // Created by Christian Klaproth on 02.12.14.
6 | // Copyright (c) 2014 Christian Klaproth. All rights reserved.
7 | //
8 |
9 | #import "CKDotMatrixFontMapping.h"
10 |
11 | @implementation CKDotMatrixFontMapping
12 |
13 | - (instancetype)init
14 | {
15 | self = [super init];
16 | if (self) {
17 | [self initializeDefaultMapping];
18 | }
19 | return self;
20 | }
21 |
22 | - (void)initializeDefaultMapping
23 | {
24 | self.defaultMapping = @{@" " : @[@"000000",
25 | @"000000",
26 | @"000000",
27 | @"000000",
28 | @"000000",
29 | @"000000",
30 | @"000000",
31 | @"000000",
32 | @"000000",
33 | @"000000"],
34 | @"0" : @[@"000000",
35 | @"001110",
36 | @"010001",
37 | @"010011",
38 | @"010101",
39 | @"011001",
40 | @"010001",
41 | @"001110",
42 | @"000000",
43 | @"000000"],
44 | @"1" : @[@"000000",
45 | @"000100",
46 | @"001100",
47 | @"010100",
48 | @"000100",
49 | @"000100",
50 | @"000100",
51 | @"011111",
52 | @"000000",
53 | @"000000"],
54 | @"2" : @[@"000000",
55 | @"001110",
56 | @"010001",
57 | @"000001",
58 | @"000010",
59 | @"000100",
60 | @"001000",
61 | @"011111",
62 | @"000000",
63 | @"000000"],
64 | @"3" : @[@"000000",
65 | @"001110",
66 | @"010001",
67 | @"000001",
68 | @"000010",
69 | @"000001",
70 | @"010001",
71 | @"001110",
72 | @"000000",
73 | @"000000"],
74 | @"4" : @[@"000000",
75 | @"000010",
76 | @"000110",
77 | @"001010",
78 | @"010010",
79 | @"011111",
80 | @"000010",
81 | @"000010",
82 | @"000000",
83 | @"000000"],
84 | @"5" : @[@"000000",
85 | @"011110",
86 | @"010000",
87 | @"010000",
88 | @"011110",
89 | @"000001",
90 | @"000001",
91 | @"011110",
92 | @"000000",
93 | @"000000"],
94 | @"6" : @[@"000000",
95 | @"001110",
96 | @"010000",
97 | @"010000",
98 | @"011110",
99 | @"010001",
100 | @"010001",
101 | @"001110",
102 | @"000000",
103 | @"000000"],
104 | @"7" : @[@"000000",
105 | @"011111",
106 | @"000001",
107 | @"000010",
108 | @"000100",
109 | @"000100",
110 | @"000100",
111 | @"000100",
112 | @"000000",
113 | @"000000"],
114 | @"8" : @[@"000000",
115 | @"001110",
116 | @"010001",
117 | @"010001",
118 | @"001110",
119 | @"010001",
120 | @"010001",
121 | @"001110",
122 | @"000000",
123 | @"000000"],
124 | @"9" : @[@"000000",
125 | @"001110",
126 | @"010001",
127 | @"010001",
128 | @"001111",
129 | @"000001",
130 | @"000001",
131 | @"001110",
132 | @"000000",
133 | @"000000"],
134 | @"-" : @[@"000000",
135 | @"000000",
136 | @"000000",
137 | @"000000",
138 | @"011111",
139 | @"000000",
140 | @"000000",
141 | @"000000",
142 | @"000000",
143 | @"000000"],
144 | @"," : @[@"000",
145 | @"000",
146 | @"000",
147 | @"000",
148 | @"000",
149 | @"000",
150 | @"001",
151 | @"001",
152 | @"010",
153 | @"000"],
154 | @"." : @[@"000",
155 | @"000",
156 | @"000",
157 | @"000",
158 | @"000",
159 | @"000",
160 | @"001",
161 | @"001",
162 | @"010",
163 | @"000"],
164 | @"A" : @[@"000000",
165 | @"000100",
166 | @"001010",
167 | @"010001",
168 | @"011111",
169 | @"010001",
170 | @"010001",
171 | @"010001",
172 | @"000000",
173 | @"000000"],
174 | @"B" : @[@"000000",
175 | @"011110",
176 | @"010001",
177 | @"010001",
178 | @"011110",
179 | @"010001",
180 | @"010001",
181 | @"011110",
182 | @"000000",
183 | @"000000"],
184 | @"C" : @[@"000000",
185 | @"001111",
186 | @"010000",
187 | @"010000",
188 | @"010000",
189 | @"010000",
190 | @"010000",
191 | @"001111",
192 | @"000000",
193 | @"000000"],
194 | @"D" : @[@"000000",
195 | @"011110",
196 | @"010001",
197 | @"010001",
198 | @"010001",
199 | @"010001",
200 | @"010001",
201 | @"011110",
202 | @"000000",
203 | @"000000"],
204 | @"E" : @[@"000000",
205 | @"011111",
206 | @"010000",
207 | @"010000",
208 | @"011110",
209 | @"010000",
210 | @"010000",
211 | @"011111",
212 | @"000000",
213 | @"000000"],
214 | @"F" : @[@"000000",
215 | @"011111",
216 | @"010000",
217 | @"010000",
218 | @"011110",
219 | @"010000",
220 | @"010000",
221 | @"010000",
222 | @"000000",
223 | @"000000"],
224 | @"G" : @[@"000000",
225 | @"001111",
226 | @"010000",
227 | @"010000",
228 | @"010011",
229 | @"010001",
230 | @"010001",
231 | @"001110",
232 | @"000000",
233 | @"000000"],
234 | @"H" : @[@"000000",
235 | @"010001",
236 | @"010001",
237 | @"010001",
238 | @"011111",
239 | @"010001",
240 | @"010001",
241 | @"010001",
242 | @"000000",
243 | @"000000"],
244 | @"I" : @[@"000000",
245 | @"011111",
246 | @"000100",
247 | @"000100",
248 | @"000100",
249 | @"000100",
250 | @"000100",
251 | @"011111",
252 | @"000000",
253 | @"000000"],
254 | @"J" : @[@"000000",
255 | @"001111",
256 | @"000001",
257 | @"000001",
258 | @"000001",
259 | @"000001",
260 | @"010001",
261 | @"001110",
262 | @"000000",
263 | @"000000"],
264 | @"K" : @[@"000000",
265 | @"010001",
266 | @"010010",
267 | @"010100",
268 | @"011000",
269 | @"010100",
270 | @"010010",
271 | @"010001",
272 | @"000000",
273 | @"000000"],
274 | @"L" : @[@"000000",
275 | @"010000",
276 | @"010000",
277 | @"010000",
278 | @"010000",
279 | @"010000",
280 | @"010000",
281 | @"011111",
282 | @"000000",
283 | @"000000"],
284 | @"M" : @[@"000000",
285 | @"010001",
286 | @"011011",
287 | @"010101",
288 | @"010001",
289 | @"010001",
290 | @"010001",
291 | @"010001",
292 | @"000000",
293 | @"000000"],
294 | @"N" : @[@"000000",
295 | @"010001",
296 | @"011001",
297 | @"010101",
298 | @"010011",
299 | @"010001",
300 | @"010001",
301 | @"010001",
302 | @"000000",
303 | @"000000"],
304 | @"O" : @[@"000000",
305 | @"001110",
306 | @"010001",
307 | @"010001",
308 | @"010001",
309 | @"010001",
310 | @"010001",
311 | @"001110",
312 | @"000000",
313 | @"000000"],
314 | @"P" : @[@"000000",
315 | @"011110",
316 | @"010001",
317 | @"010001",
318 | @"011110",
319 | @"010000",
320 | @"010000",
321 | @"010000",
322 | @"000000",
323 | @"000000"],
324 | @"Q" : @[@"000000",
325 | @"001110",
326 | @"010001",
327 | @"010001",
328 | @"010001",
329 | @"010001",
330 | @"010101",
331 | @"001110",
332 | @"000001",
333 | @"000000"],
334 | @"R" : @[@"000000",
335 | @"011110",
336 | @"010001",
337 | @"010001",
338 | @"011110",
339 | @"010100",
340 | @"010010",
341 | @"010001",
342 | @"000000",
343 | @"000000"],
344 | @"S" : @[@"000000",
345 | @"001111",
346 | @"010000",
347 | @"010000",
348 | @"001110",
349 | @"000001",
350 | @"000001",
351 | @"011110",
352 | @"000000",
353 | @"000000"],
354 | @"T" : @[@"000000",
355 | @"011111",
356 | @"000100",
357 | @"000100",
358 | @"000100",
359 | @"000100",
360 | @"000100",
361 | @"000100",
362 | @"000000",
363 | @"000000"],
364 | @"U" : @[@"000000",
365 | @"010001",
366 | @"010001",
367 | @"010001",
368 | @"010001",
369 | @"010001",
370 | @"010001",
371 | @"001110",
372 | @"000000",
373 | @"000000"],
374 | @"V" : @[@"000000",
375 | @"010001",
376 | @"010001",
377 | @"010001",
378 | @"001010",
379 | @"001010",
380 | @"001010",
381 | @"000100",
382 | @"000000",
383 | @"000000"],
384 | @"W" : @[@"000000",
385 | @"010001",
386 | @"010001",
387 | @"010001",
388 | @"010001",
389 | @"010101",
390 | @"011011",
391 | @"010001",
392 | @"000000",
393 | @"000000"],
394 | @"X" : @[@"000000",
395 | @"010001",
396 | @"010001",
397 | @"001010",
398 | @"000100",
399 | @"001010",
400 | @"010001",
401 | @"010001",
402 | @"000000",
403 | @"000000"],
404 | @"Y" : @[@"000000",
405 | @"010001",
406 | @"010001",
407 | @"001010",
408 | @"000100",
409 | @"000100",
410 | @"000100",
411 | @"000100",
412 | @"000000",
413 | @"000000"],
414 | @"Z" : @[@"000000",
415 | @"011111",
416 | @"000001",
417 | @"000010",
418 | @"000100",
419 | @"001000",
420 | @"010000",
421 | @"011111",
422 | @"000000",
423 | @"000000"]
424 | };
425 | }
426 |
427 | @end
428 |
--------------------------------------------------------------------------------