Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Added Objective-C example [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
ikorich committed Feb 11, 2017
1 parent d9e94f4 commit 242205f
Show file tree
Hide file tree
Showing 13 changed files with 711 additions and 2 deletions.
203 changes: 203 additions & 0 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Example/ExampleCropViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ExampleCropViewController: IGRPhotoTweakViewController {
self.angelSlider?.maximumValue = Float(IGRRadianAngle.toRadians(45))
self.angelSlider?.value = 0.0

setupAngelLabelValue(radians: 0.0)
setupAngelLabelValue(radians: CGFloat((self.angelSlider?.value)!))
}

fileprivate func setupAngelLabelValue(radians: CGFloat) {
Expand Down
17 changes: 17 additions & 0 deletions Example/ExampleObjC/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate.h
// ExampleObjC
//
// Created by Vitalii Parovishnyk on 2/11/17.
// Copyright © 2017 IGR Software. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;


@end

51 changes: 51 additions & 0 deletions Example/ExampleObjC/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// AppDelegate.m
// ExampleObjC
//
// Created by Vitalii Parovishnyk on 2/11/17.
// Copyright © 2017 IGR Software. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@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 invalidate graphics rendering callbacks. 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 active 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
144 changes: 144 additions & 0 deletions Example/ExampleObjC/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="1KQ-Jj-FaA">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="AkT-ml-huD">
<objects>
<viewController id="o5d-qd-XDi" customClass="ViewController" customModule="ExampleObjC" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="XDs-Nk-Yu5"/>
<viewControllerLayoutGuide type="bottom" id="Zys-gg-xQW"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Fgb-Bf-1gE">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VSX-Xt-jAb">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="VSX-Xt-jAb" firstAttribute="top" secondItem="Fgb-Bf-1gE" secondAttribute="top" id="H5R-fH-G1N"/>
<constraint firstItem="VSX-Xt-jAb" firstAttribute="leading" secondItem="Fgb-Bf-1gE" secondAttribute="leading" id="MJZ-Wz-99O"/>
<constraint firstItem="Zys-gg-xQW" firstAttribute="top" secondItem="VSX-Xt-jAb" secondAttribute="bottom" id="Sd0-5c-oGl"/>
<constraint firstAttribute="trailing" secondItem="VSX-Xt-jAb" secondAttribute="trailing" id="aCI-bK-fS9"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="v9f-jS-e5A"/>
<connections>
<outlet property="imageView" destination="VSX-Xt-jAb" id="YZj-4C-4Q1"/>
<segue destination="chW-Wb-5Rq" kind="show" identifier="showCrop" id="TL3-CP-vnj"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="gc8-rh-SMa" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2015.2" y="127.28635682158921"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="MVG-vq-AYS">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="1KQ-Jj-FaA" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="v6v-lZ-Ub0">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="o5d-qd-XDi" kind="relationship" relationship="rootViewController" id="Ed4-UM-ddR"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lgT-Dp-tfC" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1076" y="127.28635682158921"/>
</scene>
<!--Example Crop View Controller-->
<scene sceneID="ceh-qF-V5i">
<objects>
<viewController id="chW-Wb-5Rq" customClass="ExampleCropViewController" customModule="ExampleObjC" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ybp-fb-RoU"/>
<viewControllerLayoutGuide type="bottom" id="wBm-K1-hBu"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="2NZ-oz-7Q3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AXZ-1V-nSe">
<rect key="frame" x="0.0" y="623" width="375" height="44"/>
<items>
<barButtonItem title="Cancel" id="w75-uT-C6J">
<connections>
<action selector="onTouchCancelButton:" destination="chW-Wb-5Rq" id="Xbg-tR-tHM"/>
</connections>
</barButtonItem>
<barButtonItem title="Reset" id="ySg-Ne-Us8">
<connections>
<action selector="onTouchResetButton:" destination="chW-Wb-5Rq" id="uFc-jb-9V1"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="YfG-X7-gmC"/>
<barButtonItem title="Aspect" id="nCO-Pe-kJL">
<connections>
<action selector="onTouchAspectButton:" destination="chW-Wb-5Rq" id="ELy-LR-L2O"/>
</connections>
</barButtonItem>
<barButtonItem title="Crop" id="G1O-dT-rJ1">
<color key="tintColor" red="1" green="0.59999999999999998" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="onTouchCropButton:" destination="chW-Wb-5Rq" id="jA0-6q-dH5"/>
</connections>
</barButtonItem>
</items>
</toolbar>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="bSO-IX-Ss8">
<rect key="frame" x="14" y="20" width="278" height="31"/>
<connections>
<action selector="onChandeAngelSliderValue:" destination="chW-Wb-5Rq" eventType="valueChanged" id="wBs-WA-Tlv"/>
<action selector="onEndTouchAngelControl:" destination="chW-Wb-5Rq" eventType="touchUpInside" id="Uvq-iL-Ahd"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RyZ-mw-d2h">
<rect key="frame" x="298" y="29" width="61" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="61" id="D01-f2-tFh"/>
<constraint firstAttribute="height" constant="21" id="zP6-GS-M3u"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="RyZ-mw-d2h" firstAttribute="trailing" secondItem="2NZ-oz-7Q3" secondAttribute="trailingMargin" id="6Oe-MY-w9I"/>
<constraint firstItem="AXZ-1V-nSe" firstAttribute="leading" secondItem="2NZ-oz-7Q3" secondAttribute="leading" id="L0f-g1-czj"/>
<constraint firstAttribute="trailing" secondItem="AXZ-1V-nSe" secondAttribute="trailing" id="Ooh-sC-tCL"/>
<constraint firstItem="RyZ-mw-d2h" firstAttribute="top" secondItem="Ybp-fb-RoU" secondAttribute="bottom" constant="9" id="eNF-RN-Mpu"/>
<constraint firstItem="bSO-IX-Ss8" firstAttribute="leading" secondItem="2NZ-oz-7Q3" secondAttribute="leading" constant="16" id="iTz-hu-Afc"/>
<constraint firstItem="RyZ-mw-d2h" firstAttribute="leading" secondItem="bSO-IX-Ss8" secondAttribute="trailing" constant="8" id="oy5-2w-g4G"/>
<constraint firstItem="wBm-K1-hBu" firstAttribute="top" secondItem="AXZ-1V-nSe" secondAttribute="bottom" id="tf5-4r-l02"/>
<constraint firstItem="bSO-IX-Ss8" firstAttribute="top" secondItem="Ybp-fb-RoU" secondAttribute="bottom" id="xhE-Ex-fQ4"/>
</constraints>
</view>
<connections>
<outlet property="angelLabel" destination="RyZ-mw-d2h" id="AIL-UL-cyc"/>
<outlet property="angelSlider" destination="bSO-IX-Ss8" id="jjY-S0-QBq"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2Tx-kZ-nfE" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3018" y="127"/>
</scene>
</scenes>
</document>
13 changes: 13 additions & 0 deletions Example/ExampleObjC/ExampleCropViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ExampleCropViewController.h
// Example
//
// Created by Vitalii Parovishnyk on 2/11/17.
// Copyright © 2017 IGR Software. All rights reserved.
//

#import "ExampleObjC-Bridging-Header.h"

@interface ExampleCropViewController : IGRPhotoTweakViewController

@end
Loading

0 comments on commit 242205f

Please sign in to comment.