Skip to content

Commit

Permalink
● iPad Support
Browse files Browse the repository at this point in the history
● New version
  • Loading branch information
MaorS committed Oct 31, 2017
1 parent a27ca1e commit dee8600
Show file tree
Hide file tree
Showing 21 changed files with 553 additions and 408 deletions.
Binary file removed Example/media/fullActionSheet.gif
Binary file not shown.
46 changes: 23 additions & 23 deletions Example/xcode projects/MSActionSheet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
E13C608E1E982AB600FE6DB9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E13C608D1E982AB600FE6DB9 /* AppDelegate.swift */; };
E13C60901E982AB600FE6DB9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E13C608F1E982AB600FE6DB9 /* ViewController.swift */; };
E13C60931E982AB600FE6DB9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E13C60911E982AB600FE6DB9 /* Main.storyboard */; };
E13C60961E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */; };
E13C609B1E982AB600FE6DB9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E13C60991E982AB600FE6DB9 /* LaunchScreen.storyboard */; };
E1CD4FFE1E98CDEA006FB0CE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E1CD4FFC1E98CDEA006FB0CE /* Assets.xcassets */; };
E1CD4FFF1E98CDEA006FB0CE /* MSActionSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1CD4FFD1E98CDEA006FB0CE /* MSActionSheet.swift */; };
Expand All @@ -21,7 +20,6 @@
E13C608D1E982AB600FE6DB9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
E13C608F1E982AB600FE6DB9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
E13C60921E982AB600FE6DB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MSActionSheet.xcdatamodel; sourceTree = "<group>"; };
E13C609A1E982AB600FE6DB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
E13C609C1E982AB600FE6DB9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E1CD4FFC1E98CDEA006FB0CE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -65,7 +63,6 @@
E13C60911E982AB600FE6DB9 /* Main.storyboard */,
E13C60991E982AB600FE6DB9 /* LaunchScreen.storyboard */,
E13C609C1E982AB600FE6DB9 /* Info.plist */,
E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */,
);
path = MSActionSheet;
sourceTree = "<group>";
Expand Down Expand Up @@ -97,12 +94,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Maor Shams";
TargetAttributes = {
E13C60891E982AB600FE6DB9 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = LE75NS246X;
DevelopmentTeam = FPKJ9P7BGC;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -146,7 +144,6 @@
E13C60901E982AB600FE6DB9 /* ViewController.swift in Sources */,
E1CD4FFF1E98CDEA006FB0CE /* MSActionSheet.swift in Sources */,
E13C608E1E982AB600FE6DB9 /* AppDelegate.swift in Sources */,
E13C60961E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -182,15 +179,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -233,15 +236,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -271,25 +280,29 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = LE75NS246X;
DEVELOPMENT_TEAM = FPKJ9P7BGC;
INFOPLIST_FILE = MSActionSheet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = maor.MSActionSheet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
E13C60A11E982AB600FE6DB9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = LE75NS246X;
DEVELOPMENT_TEAM = FPKJ9P7BGC;
INFOPLIST_FILE = MSActionSheet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = maor.MSActionSheet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -315,19 +328,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCVersionGroup section */
E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */,
);
currentVersion = E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */;
path = MSActionSheet.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = E13C60821E982AB600FE6DB9 /* Project object */;
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MSActionSheet/ViewController.swift"
timestampString = "531165326.469337"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
endingLineNumber = "16"
landmarkName = "selectImageAction(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>MSActionSheet.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
47 changes: 1 addition & 46 deletions Example/xcode projects/MSActionSheet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}

// MARK: - Core Data stack

lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "MSActionSheet")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.

/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()

// MARK: - Core Data Saving support

func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}


}

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Compact Camera_000000_32.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Compact Camera_000000_50.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Xlarge Icons_000000_32.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Xlarge Icons_000000_50.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Selfie_000000_32.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Selfie_000000_50.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions Example/xcode projects/MSActionSheet/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16A313a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -22,13 +24,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Qta-wc-joH">
<rect key="frame" x="12.5" y="158" width="350" height="350"/>
<rect key="frame" x="57" y="202" width="262.5" height="262.5"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstAttribute="width" constant="350" id="L2u-CY-bMd"/>
<constraint firstAttribute="height" constant="350" id="MDr-aV-bus"/>
<constraint firstAttribute="width" secondItem="Qta-wc-joH" secondAttribute="height" multiplier="1:1" id="8jt-Kt-fYE"/>
</constraints>
<state key="normal" title="Select picture">
<color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleColor" red="0.0" green="0.58980089430000004" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="selectImageAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="vg6-yZ-1M4"/>
Expand All @@ -37,8 +39,9 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Qta-wc-joH" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="34h-1P-GkN"/>
<constraint firstItem="Qta-wc-joH" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="5wB-8p-E2b"/>
<constraint firstItem="Qta-wc-joH" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" multiplier="0.7" id="Pt1-Dm-h7R"/>
<constraint firstItem="Qta-wc-joH" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="UAQ-Qn-App"/>
<constraint firstItem="Qta-wc-joH" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="uwg-BJ-VK5"/>
</constraints>
</view>
</viewController>
Expand Down
Loading

0 comments on commit dee8600

Please sign in to comment.