Skip to content
This repository was archived by the owner on Jun 13, 2021. It is now read-only.

Commit 833ac5b

Browse files
committed
Added Swift Support for UIImagePickerController Customization
• Added Swift Support for UIImagePickerController Customization. • Fixed Swift Naming Convention Warnings
1 parent e02a817 commit 833ac5b

20 files changed

+641
-28
lines changed

Chameleon.xcodeproj/project.pbxproj

+203-15
Large diffs are not rendered by default.

Chameleon/Chameleon.h

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ FOUNDATION_EXPORT const unsigned char ChameleonVersionString[];
2323
#import "UIColor+ChameleonPrivate.h"
2424
#import "UIImage+ChameleonPrivate.h"
2525
#import "UIView+ChameleonPrivate.h"
26+
#import "UIAppearance+Swift.h"
2627

2728
#import "NSArray+Chameleon.h"
2829
#import "UIColor+Chameleon.h"

ChameleonDemo-Objc/AppDelegate.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// AppDelegate.h
3+
// ChameleonDemo-Objc
4+
//
5+
// Created by Vicc Alexander on 11/26/15.
6+
// Copyright © 2015 Vicc Alexander. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
@import Chameleon;
11+
12+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
13+
14+
@property (strong, nonatomic) UIWindow *window;
15+
16+
17+
@end
18+

ChameleonDemo-Objc/AppDelegate.m

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// AppDelegate.m
3+
// ChameleonDemo-Objc
4+
//
5+
// Created by Vicc Alexander on 11/26/15.
6+
// Copyright © 2015 Vicc Alexander. 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+
20+
//Set global theme
21+
//[Chameleon setGlobalThemeUsingPrimaryColor:FlatMint withSecondaryColor:FlatBlue andContentStyle:UIContentStyleContrast];
22+
23+
[Chameleon setGlobalThemeUsingPrimaryColor:FlatMint withContentStyle:UIContentStyleContrast];
24+
25+
26+
return YES;
27+
}
28+
29+
- (void)applicationWillResignActive:(UIApplication *)application {
30+
// 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.
31+
// 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.
32+
}
33+
34+
- (void)applicationDidEnterBackground:(UIApplication *)application {
35+
// 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.
36+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37+
}
38+
39+
- (void)applicationWillEnterForeground:(UIApplication *)application {
40+
// 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.
41+
}
42+
43+
- (void)applicationDidBecomeActive:(UIApplication *)application {
44+
// 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.
45+
}
46+
47+
- (void)applicationWillTerminate:(UIApplication *)application {
48+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
49+
}
50+
51+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="EHf-IW-A2E">
9+
<objects>
10+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
13+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<animations/>
19+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="DDR-cw-uah">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
6+
</dependencies>
7+
<scenes>
8+
<!--Chameleon-->
9+
<scene sceneID="htd-oj-yMi">
10+
<objects>
11+
<viewController id="bxX-DA-4YG" customClass="ViewController" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="XeJ-fS-pDC"/>
14+
<viewControllerLayoutGuide type="bottom" id="bo3-pv-2fG"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="7XF-ox-U3N">
17+
<rect key="frame" x="0.0" y="64" width="600" height="536"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<subviews>
20+
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="Fcl-sO-xGd">
21+
<rect key="frame" x="35" y="89" width="94" height="29"/>
22+
<animations/>
23+
</stepper>
24+
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" fixedFrame="YES" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="uno-15-6FV">
25+
<rect key="frame" x="35" y="205" width="150" height="2"/>
26+
<animations/>
27+
</progressView>
28+
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tZl-0w-AEK">
29+
<rect key="frame" x="178" y="141" width="51" height="31"/>
30+
<animations/>
31+
</switch>
32+
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="sEd-ni-n9b">
33+
<rect key="frame" x="33" y="240" width="118" height="31"/>
34+
<animations/>
35+
</slider>
36+
<segmentedControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="OD8-BK-xRp">
37+
<rect key="frame" x="35" y="143" width="121" height="29"/>
38+
<animations/>
39+
<segments>
40+
<segment title="First"/>
41+
<segment title="Second"/>
42+
</segments>
43+
</segmentedControl>
44+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vd1-BC-0GS">
45+
<rect key="frame" x="181" y="240" width="46" height="30"/>
46+
<animations/>
47+
<state key="normal" title="Button"/>
48+
</button>
49+
<pageControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="5" translatesAutoresizingMaskIntoConstraints="NO" id="02d-LT-XqT">
50+
<rect key="frame" x="137" y="85" width="90" height="37"/>
51+
<animations/>
52+
</pageControl>
53+
</subviews>
54+
<animations/>
55+
<color key="backgroundColor" red="0.80000000000000004" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
56+
</view>
57+
<navigationItem key="navigationItem" title="Chameleon" id="qSC-Xc-gWl"/>
58+
</viewController>
59+
<placeholder placeholderIdentifier="IBFirstResponder" id="y4Y-TI-tC2" sceneMemberID="firstResponder"/>
60+
</objects>
61+
<point key="canvasLocation" x="1877" y="283"/>
62+
</scene>
63+
<!--Navigation Controller-->
64+
<scene sceneID="TU8-a7-Gfj">
65+
<objects>
66+
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="DDR-cw-uah" sceneMemberID="viewController">
67+
<toolbarItems/>
68+
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="hi6-Wf-Ozl">
69+
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
70+
<autoresizingMask key="autoresizingMask"/>
71+
<animations/>
72+
<color key="barTintColor" red="1" green="0.0" blue="1" alpha="1" colorSpace="calibratedRGB"/>
73+
</navigationBar>
74+
<nil name="viewControllers"/>
75+
<connections>
76+
<segue destination="bxX-DA-4YG" kind="relationship" relationship="rootViewController" id="okW-km-o5G"/>
77+
</connections>
78+
</navigationController>
79+
<placeholder placeholderIdentifier="IBFirstResponder" id="bwH-Yb-JKT" userLabel="First Responder" sceneMemberID="firstResponder"/>
80+
</objects>
81+
<point key="canvasLocation" x="1065" y="283"/>
82+
</scene>
83+
</scenes>
84+
</document>

ChameleonDemo-Objc/Info.plist

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIMainStoryboardFile</key>
28+
<string>Main</string>
29+
<key>UIRequiredDeviceCapabilities</key>
30+
<array>
31+
<string>armv7</string>
32+
</array>
33+
<key>UISupportedInterfaceOrientations</key>
34+
<array>
35+
<string>UIInterfaceOrientationPortrait</string>
36+
<string>UIInterfaceOrientationLandscapeLeft</string>
37+
<string>UIInterfaceOrientationLandscapeRight</string>
38+
</array>
39+
<key>UIViewControllerBasedStatusBarAppearance</key>
40+
<false/>
41+
</dict>
42+
</plist>

ChameleonDemo-Objc/ViewController.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// ViewController.h
3+
// ChameleonDemo-Objc
4+
//
5+
// Created by Vicc Alexander on 11/26/15.
6+
// Copyright © 2015 Vicc Alexander. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
@import Chameleon;
11+
12+
@interface ViewController : UIViewController
13+
14+
15+
@end
16+

ChameleonDemo-Objc/ViewController.m

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// ViewController.m
3+
// ChameleonDemo-Objc
4+
//
5+
// Created by Vicc Alexander on 11/26/15.
6+
// Copyright © 2015 Vicc Alexander. All rights reserved.
7+
//
8+
9+
#import "ViewController.h"
10+
11+
@interface ViewController ()
12+
13+
@end
14+
15+
@implementation ViewController
16+
17+
- (void)viewDidLoad {
18+
19+
//Super
20+
[super viewDidLoad];
21+
22+
//Set View Background
23+
self.view.backgroundColor = FlatYellow;
24+
}
25+
26+
- (void)didReceiveMemoryWarning {
27+
28+
//Super
29+
[super didReceiveMemoryWarning];
30+
}
31+
32+
@end

ChameleonDemo-Objc/main.m

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// main.m
3+
// ChameleonDemo-Objc
4+
//
5+
// Created by Vicc Alexander on 11/26/15.
6+
// Copyright © 2015 Vicc Alexander. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
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+
}

ChameleonDemo/Base.lproj/Main.storyboard

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9046" systemVersion="14F25a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Xln-K6-UFC">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Xln-K6-UFC">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9035"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
66
</dependencies>
77
<scenes>
88
<!--Title goes Here-->

ChameleonDemo/Info.plist

+2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@
4343
<string>UIInterfaceOrientationLandscapeLeft</string>
4444
<string>UIInterfaceOrientationLandscapeRight</string>
4545
</array>
46+
<key>UIViewControllerBasedStatusBarAppearance</key>
47+
<false/>
4648
</dict>
4749
</plist>

ChameleonDemo/ViewController.swift

-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ class ViewController: UIViewController {
1717

1818
view.backgroundColor = FlatYellow()
1919
}
20-
2120
}
22-

Pod/Classes/Objective-C/Chameleon.h

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ FOUNDATION_EXPORT const unsigned char ChameleonVersionString[];
2323
#import "UIColor+ChameleonPrivate.h"
2424
#import "UIImage+ChameleonPrivate.h"
2525
#import "UIView+ChameleonPrivate.h"
26+
#import "UIAppearance+Swift.h"
2627

2728
#import "NSArray+Chameleon.h"
2829
#import "UIColor+Chameleon.h"

0 commit comments

Comments
 (0)