Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated project, removed warnings and added pod spec. #68

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions KTPhotoBrowser.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Pod::Spec.new do |s|
s.name = "KTPhotoBrowser"
s.version = "0.0.2"
s.summary = "A lightweight photo browser library for the iPhone and iPod touch that looks and behaves like the iPhone Photos app."
s.homepage = "https://github.com/kirbyt/KTPhotoBrowser"
s.license = "MIT"
s.author = "Kirby Turner"
s.source = { :git => "https://github.com/mtlhd/KTPhotoBrowser.git", :tag => "0.0.2" }
s.platform = :ios, "3.0"
s.source_files = "src/KTPhotoBrowser/**/*.{h,m}"
s.requires_arc = false
end
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
689D24D11322CF8A00A08DEC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "White Peak Software Inc.";
};
buildConfigurationList = 689D24D41322CF8A00A08DEC /* Build configuration list for PBXProject "Flickr+JSONSample" */;
Expand Down Expand Up @@ -400,29 +401,28 @@
689D24F31322CF8B00A08DEC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
689D24F41322CF8B00A08DEC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
};
Expand All @@ -436,6 +436,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Flickr+JSONSample/Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "Flickr+JSONSample/Info.plist";
INSTALL_PATH = "$(LOCAL_APPS_DIR)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -450,6 +451,7 @@
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Flickr+JSONSample/Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "Flickr+JSONSample/Info.plist";
INSTALL_PATH = "$(LOCAL_APPS_DIR)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
39 changes: 24 additions & 15 deletions src/KTPhotoBrowser/KTPhotoScrollViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@ - (void)dealloc

- (id)initWithDataSource:(id <KTPhotoBrowserDataSource>)dataSource andStartWithPhotoAtIndex:(NSUInteger)index
{
if (self = [super init]) {
startWithIndex_ = index;
dataSource_ = [dataSource retain];

// Make sure to set wantsFullScreenLayout or the photo
// will not display behind the status bar.
[self setWantsFullScreenLayout:YES];

BOOL isStatusbarHidden = [[UIApplication sharedApplication] isStatusBarHidden];
[self setStatusbarHidden:isStatusbarHidden];

self.hidesBottomBarWhenPushed = YES;
}
return self;
if (self = [super init]) {
startWithIndex_ = index;
dataSource_ = [dataSource retain];

// Make sure to set wantsFullScreenLayout or the photo
// will not display behind the status bar.
#ifdef __IPHONE_7_0
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;
#else
[self setWantsFullScreenLayout:YES];
#endif
BOOL isStatusbarHidden = [[UIApplication sharedApplication] isStatusBarHidden];
[self setStatusbarHidden:isStatusbarHidden];

self.hidesBottomBarWhenPushed = YES;
}

return self;
}

- (void)loadView
Expand Down Expand Up @@ -220,7 +225,11 @@ - (void)viewWillAppear:(BOOL)animated
}
// Then ensure translucency. Without it, the view will appear below rather than under it.
[navbar setTranslucent:YES];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
#ifdef __IPHONE_7_0
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
#else
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
#endif

// Set the scroll view's content size, auto-scroll to the stating photo,
// and setup the other display elements.
Expand Down
6 changes: 3 additions & 3 deletions src/KTPhotoBrowser/KTThumbsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

// We use the following ivars to keep track of
// which thumbnail view indexes are visible.
int firstVisibleIndex_;
int lastVisibleIndex_;
int lastItemsPerRow_;
NSInteger firstVisibleIndex_;
NSInteger lastVisibleIndex_;
NSInteger lastItemsPerRow_;
}

@property (nonatomic, assign) id<KTThumbsViewDataSource> dataSource;
Expand Down
16 changes: 8 additions & 8 deletions src/KTPhotoBrowser/KTThumbsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ - (void)layoutSubviews
// Do a bunch of math to determine which rows and colums
// are visible.

int itemsPerRow = thumbsPerRow_;
NSInteger itemsPerRow = thumbsPerRow_;
if (itemsPerRow == NSIntegerMin) {
itemsPerRow = floor(visibleWidth / thumbSize_.width);
}
Expand All @@ -113,14 +113,14 @@ - (void)layoutSubviews

if (itemsPerRow < 1) itemsPerRow = 1; // Ensure at least one per row.

int spaceWidth = round((visibleWidth - thumbSize_.width * itemsPerRow) / (itemsPerRow + 1));
int spaceHeight = spaceWidth;
CGFloat spaceWidth = round((visibleWidth - thumbSize_.width * itemsPerRow) / (itemsPerRow + 1));
CGFloat spaceHeight = spaceWidth;

// Calculate content size.
int thumbCount = [dataSource_ thumbsViewNumberOfThumbs:self];
int rowCount = ceil(thumbCount / (float)itemsPerRow);
int rowHeight = thumbSize_.height + spaceHeight;
CGSize contentSize = CGSizeMake(visibleWidth, (rowHeight * rowCount + spaceHeight));
NSInteger thumbCount = [dataSource_ thumbsViewNumberOfThumbs:self];
int rowCount = (int)ceil(thumbCount / (float)itemsPerRow);
CGFloat rowHeight = thumbSize_.height + spaceHeight;
CGSize contentSize = CGSizeMake(visibleWidth, (rowHeight * (CGFloat)rowCount + spaceHeight));
[self setContentSize:contentSize];

NSInteger rowsPerView = visibleHeight / rowHeight;
Expand Down Expand Up @@ -157,7 +157,7 @@ - (void)layoutSubviews

// Iterate through the needed thumbnail views adding
// any views that are missing.
for (int index = startAtIndex; index < stopAtIndex; index++) {
for (NSInteger index = startAtIndex; index < stopAtIndex; index++) {
// If index is between first and last, then not missing.
BOOL isThumbViewMissing = !(index >= firstVisibleIndex_ && index < lastVisibleIndex_);

Expand Down
7 changes: 6 additions & 1 deletion src/KTPhotoBrowser/KTThumbsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ - (void)dealloc {
- (void)loadView {
// Make sure to set wantsFullScreenLayout or the photo
// will not display behind the status bar.
[self setWantsFullScreenLayout:YES];
#ifdef __IPHONE_7_0
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;
#else
[self setWantsFullScreenLayout:YES];
#endif

KTThumbsView *scrollView = [[KTThumbsView alloc] initWithFrame:CGRectZero];
[scrollView setDataSource:self];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -191,8 +191,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ReallyBigPhotoLibrary" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -281,27 +284,28 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = iphoneos4.1;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PREBINDING = NO;
SDKROOT = iphoneos4.1;
SDKROOT = iphoneos;
};
name = Release;
};
Expand Down
6 changes: 5 additions & 1 deletion src/Sample/Classes/SampleAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ @implementation SampleAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
#ifdef __IPHONE_7_0
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
#else
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
#endif

UINavigationController *newNavController;

Expand Down
18 changes: 10 additions & 8 deletions src/Sample/Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -309,8 +309,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Sample" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -416,29 +419,28 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DDEBUG=1";
PREBINDING = NO;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
PREBINDING = NO;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Release;
};
Expand Down
16 changes: 10 additions & 6 deletions src/TabBarSample/TabBarSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -296,8 +296,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TabBarSample" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -398,27 +401,28 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PREBINDING = NO;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Release;
};
Expand Down
5 changes: 4 additions & 1 deletion src/iAdSample/Classes/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ - (void)loadView

// Build a new view hierarchy.

[self setWantsFullScreenLayout:NO];
#ifdef __IPHONE_7_0
#else
[self setWantsFullScreenLayout:NO];
#endif

UIView *newContainerView = [[UIView alloc] initWithFrame:CGRectZero];
[newContainerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
Expand Down
Loading